http://www.perlmonks.org?node_id=1017192


in reply to Re: RegEx - Positive Look-ahead
in thread RegEx - Positive Look-ahead

Thank You!

I modified my RegEx like so:

( # start of capture group 1 {{ # match an opening (?: [^{{}}]++ # one or more, non backtracking | (?1) # found {{ or }}, so recurse to captur +e group 1 )* }} # match a closing ) # end of capture group 1

The problem is that this does not match if I have {{ something {{{ text }}} }} in my content ...

Replies are listed 'Best First'.
Re^3: RegEx - Positive Look-ahead
by Anonymous Monk on Feb 05, 2013 at 14:50 UTC
    if you want to match {{{ and {{ maybe you can make it
    [{]{2,3} # opener [}]{2,3} # closer