Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW

Re: Regexp for Match Brackets

by sen (Hermit)
on May 05, 2006 at 06:50 UTC ( #547599=note: print w/ replies, xml ) Need Help??

in reply to Regexp for Match Brackets

hi Gopal, try this one

print $& if $text=~m#(\(.*\))#;

Comment on Re: Regexp for Match Brackets
Download Code
Replies are listed 'Best First'.
Re^2: Regexp for Match Brackets
by turo (Friar) on May 05, 2006 at 13:19 UTC

    the problem of your solution is that it takes all the text (parenthesis included) between the first open parenthesis and the last closed parenthesis, even if they are not balanced! :-P


    perl -Te 'print map { chr((ord)-((10,20,2,7)[$i++])) } split //,"turo"'

Log In?

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

How do I use this? | Other CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (2)
As of 2015-11-30 07:39 GMT
Find Nodes?
    Voting Booth?

    What would be the most significant thing to happen if a rope (or wire) tied the Earth and the Moon together?

    Results (765 votes), past polls