Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical
 
PerlMonks  

Re: How to Extract Nested IF/THEN elements

by I0 (Priest)
on Jun 21, 2002 at 07:34 UTC ( #176244=note: print w/ replies, xml ) Need Help??


in reply to How to Extract Nested IF/THEN elements

$_ = " IF(A) anytext IF(B) anytext ENDIF IF(C) anytext ENDIF and on .... ENDIF "; @( = ('(',''); @) = (')',''); ($re=$_)=~s/((\bIF\b)|(\bENDIF\b)|.)/$([!$2]\Q$1\E$)[!$3]/gs; print join"\n\n",eval{/$re/},""; warn $@ if $@=~/unmatched/;


Comment on Re: How to Extract Nested IF/THEN elements
Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (4)
As of 2015-03-28 22:18 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    When putting a smiley right before a closing parenthesis, do you:









    Results (627 votes), past polls