Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number
 
PerlMonks  

Re: Regexp for Match Brackets

by Samy_rio (Vicar)
on May 05, 2006 at 07:12 UTC ( #547601=note: print w/replies, xml ) Need Help??


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

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://547601]
help
Chatterbox?
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others imbibing at the Monastery: (7)
As of 2018-04-19 22:19 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Notices?