title: How to parse triple stashed tags in handlebarsjs using Python parse
body: <p><strong>Background</strong></p>
  
  <p>I am using the handlebars templating language to create documents. In order to create the JSON-file to populate a certain handlebars file with values, I want to extract all handlebars expressions in that file, using a Python script. The Python parse module seems right for the job, since it has a findall function, which finds all occurrences of a certain pattern.</p>
  
  <p><strong>Problem</strong></p>
  
  <p>Parse uses braces to enclose the pattern to be searched for, e.g.</p>
  
  <pre><code>parse("One {} three", "One two three")
  </code></pre>
  
  <p>yields</p>
  
  <pre><code>&lt;Result ('two',) {}&gt;
  </code></pre>
  
  <p>However, the patterns I am looking for are tripple stashed like so</p>
  
  <pre><code>{{{&lt;some expression&gt;}}}
  </code></pre>
  
  <p>which would force me to escape the braces. I tried using backslash, i.e.</p>
  
  <pre><code>parse("One \{\{\{{}\}\}\} three", "One {{{some_number}}} three")
  </code></pre>
  
  <p>in order to extract</p>
  
  <pre><code>some_number
  </code></pre>
  
  <p>but this does not work. Is there another way?</p>