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

Re: Non deliminatd Nested text

by I0 (Priest)
on Jun 24, 2002 at 13:28 UTC ( [id://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,"";

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others chanting in the Monastery: (7)
As of 2024-04-25 16:15 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found