Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<blockquote> <p>Also, I have "SingleLine" checked because I want . to match \n</p> </blockquote> <p>If you untick “Single line” it will work. So obviously your <code>.</code> is the problem. An easy solution would be to use <code>.*?</code> instead of <code>.*</code> as that will non-greedily select just as much as it needs (instead of greedily selecting as much as possible). Another solution would be to replace the <code>.</code> by something more specific, like a negative look-ahead as you probably do no want to match another <code>{{</code> inside of it (or even <code>}}</code>). But in this case the non-greedy solution is much easier.</p> <p>You should probably change the multiplicator of the field character class as well so it won’t match things that are already part of the looptemplate.</p> <p>Also note that <code>[ &gt; ]</code> is a character class that will select either a space or <code>&gt;</code>. So it will not select <code>" &gt; "</code>. If you want that, just leave the brackets off:</p> <pre><code>\{\{(?&lt;field&gt;[^&gt;]*?)? &gt; (?&lt;looptemplate&gt;[^}].*?)?\}\} </code></pre> <p>In your case, as you probably want to make the looptemplate thing optional, you probably want to do it like this though, with a non-capturing group:</p> <pre><code>\{\{(?&lt;field&gt;[^&gt;]*?)?(?: &gt; (?&lt;looptemplate&gt;[^}].*?))?\}\} </code></pre> <p>Also one final note; if you want the <code>.</code> to match line breaks, better provide an example where that is necessary.</p> <p>(Okay, another note, as m.buettner correctly mentioned in his answer, character classes only need to mention each character once; furthermore, you do not need to escape curly braces inside character classes, so it all simplifies to just <code>[^}]</code>)</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload