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"'