title: PEG parser in pest to match regex within triple quotes, tried at https://pest.rs/
body: <p>I am writing a PEG file to be used in <a href="https://github.com/pest-parser/pest" rel="nofollow noreferrer">pest</a> for our dsl. There is need where i need to parse a key value where value is a regex within triple quote. I am unable to write a pest rule for it.</p>
  
  <p>The value is  <code>"""Some regex here"""</code></p>
  
  <p>Rule I defined is:</p>
  
  <pre><code>TQ = {"\"\"\""}
  </code></pre>
  
  <p>and I need</p>
  
  <pre><code>regex = {TQ ~ Anything but not TQ ~ TQ}
  </code></pre>
  
  <p>I tried with </p>
  
  <pre><code>regex = {TQ ~(!TQ)* ~ TQ}
  </code></pre>
  
  <p>which doesn't work and not proper PEG</p>
  
  <pre><code>regex = {TQ ~ ANY* ~ TQ}
  </code></pre>
  
  <p>which greedily consumes all token even triple quotes at the end</p>
  
  <p>The rule should parse regex inside triple quotes like</p>
  
  <pre><code> """^\w+\s+\d\d\d\d\-\d\d\-\d\d\s+\d\d\:\d\d\:\d\d\s+AB_02V\s+\d+\s+.*"""
  </code></pre>