Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight
 
PerlMonks  

Re: Regarding pattern Matching

by kcott (Archbishop)
on Feb 04, 2017 at 13:39 UTC ( [id://1181087]=note: print w/replies, xml ) Need Help??


in reply to Regarding pattern Matching

G'day Nansh,

Welcome to the Monastery.

As already pointed out by others, this is a poorly presented question. Without knowing what regex you've used, or what output your current code produces, it's impossible to say, with any certainty, why you're not getting the output you want. Please read "How do I post a question effectively?" before posting again.

As a complete guess, given you need parentheses to capture text that, itself, includes parentheses, you may not have escaped parentheses correctly (see perlre):

$ perl -E 'say +("X(a,b,c)" =~ /X(\([^)]+\))/)[0]' (a,b,c)

Also consider stepping through your matching code with Regexp::Debugger.

— Ken

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1181087]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others exploiting the Monastery: (3)
As of 2024-04-20 01:21 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found