Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic
 
PerlMonks  

Re^2: regex for nested "<"/">'

by jo37 (Deacon)
on Feb 12, 2020 at 21:42 UTC ( [id://11112889]=note: print w/replies, xml ) Need Help??


in reply to Re: regex for nested "<"/">'
in thread regex for nested "<"/">'

For balanced begin/end matching, this might do:
$re = qr{ ( (?: (?&OPEN) (?: (?>(?:.*?(?=(?&OPEN)|(?&CLOSE)))) | (?-1) )* (?&CLOSE) ) ) (?(DEFINE) (?<OPEN>\bBEGIN\b) (?<CLOSE>\bEND\b) )}x;

Replies are listed 'Best First'.
Re^3: regex for nested "<"/">'
by clueless newbie (Curate) on Feb 12, 2020 at 22:20 UTC

    You're my hero!

    Now to figure out exactly how it works!

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others goofing around in the Monastery: (5)
As of 2024-03-28 17:11 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found