Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight
 
PerlMonks  

Re^2: RegEx - Positive Look-ahead

by tmharish (Friar)
on Feb 05, 2013 at 14:45 UTC ( #1017192=note: print w/ replies, xml ) Need Help??


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 ...


Comment on Re^2: RegEx - Positive Look-ahead
Download Code
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

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1017192]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others taking refuge in the Monastery: (7)
As of 2014-07-31 08:39 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My favorite superfluous repetitious redundant duplicative phrase is:









    Results (246 votes), past polls