Hi gopalr, If I understood your question correctly then try this,
use Regexp::Common; while (<DATA>) { (/$RE{balanced}{-begin => "("}{-end => ")"}/) ? (print "Line $. : Matc +hed: $&\n") : (print "Line $. : Not Matched\n"); } __DATA__ This is my (one dfd(two(three)four()(five)df())df) text. This is my (one text.
Output is :
Line 1 : Matched: (one dfd(two(three)four()(five)df())df) Line 2 : Not Matched
Regards,
Velusamy R.
In reply to Re: Regexp for Match Brackets
by Samy_rio
in thread Regexp for Match Brackets
by gopalr
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |