$_ = qq(For eg., if the text is given as <code start>I am (giving this (text to (tell you) that this) will give +) you the result. <code end> In this case, I need the phrase, (giving this (text to (tel +l you) that this) will give) This should hold for any number of nested paranthesis.); (my $re = $_) =~ s/((\()|(\))|.)/${['(','']}[!$2]\Q$1\E${[')','']}[!$3 +]/gs; print eval{(/$re/)[0]},"\n"; warn $@ if $@;
In reply to Re: RegEx for Matching paranthesis
by I0
in thread RegEx for Matching paranthesis
by Anonymous Monk
For: | Use: | ||
& | & | ||
< | < | ||
> | > | ||
[ | [ | ||
] | ] |