http://www.perlmonks.org?node_id=547601


in reply to Regexp for Match Brackets

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.


eval"print uc\"\\c$_\""for split'','j)@,/6%@0%2,`e@3!-9v2)/@|6%,53!-9@2~j';