Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change
 
PerlMonks  

Re: Non deliminatd Nested text

by I0 (Priest)
on Jun 24, 2002 at 13:28 UTC ( #176779=note: print w/ replies, xml ) Need Help??


in reply to Non deliminatd Nested text

$_ = '[S [NP This NP] [VP is [NP [NP the turning point NP] [PP to [NP +the left NP] PP] NP] VP] . S]'; #$_ = '[VP This stuff is [NP the left NP] [NP other thing NP] VP]'; @( = ('(',''); @) = (')',''); ($re=$_)=~s/((\[\w+\s*)|(\s*\w+\])|.)/$)[!$3]\Q$1\E$([!$2]/gs; $re = join'|',map{quotemeta}eval{/$re/}; die $@ if $@=~/unmatched/; $_ = (eval{/($re)/})[0]; print join"\n\n",/\s*(\[\w+\s*(?:$re)\s*\w+\]|[^][]*)/g,"";


Comment on Re: Non deliminatd Nested text
Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others chanting in the Monastery: (2)
As of 2014-07-31 00:49 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My favorite superfluous repetitious redundant duplicative phrase is:









    Results (242 votes), past polls