Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
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 examining the Monastery: (17)
As of 2015-07-29 20:23 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (268 votes), past polls