Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
PerlMonks  

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#(\(.*\))#;

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

    cheers

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

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://547599]
help
Chatterbox?
[moritz]: good morning
[moritz]: perl -MNetAddr::IP -wE 'say NetAddr::IP->new( "2001:780:233::/ 64")->hostenum' dies with netmask error: overrange or spurious bits at -e line 1.
[moritz]: any idea what's wrong?
[moritz]: seems there's a size limit for hostenum, and the error message just sucks

How do I use this? | Other CB clients
Other Users?
Others taking refuge in the Monastery: (8)
As of 2017-04-25 07:35 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    I'm a fool:











    Results (449 votes). Check out past polls.