Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister
 
PerlMonks  

Re: Parens mess up regex substitute

by ikegami (Pope)
on Jan 26, 2012 at 04:19 UTC ( #950022=note: print w/ replies, xml ) Need Help??


in reply to Parens mess up regex substitute

but I want to know why parens in the variable screwed up one substitute but not the other one

The first argument of the substitution operator is {expected to be|treated as} a regex pattern.

The regex pattern «f(il)e» (line 7) matches the string «file» and captures «il» in $1 or some such variable.

The regex pattern «f\(il\)e» (line 11) matches the string «f(il)e».


Comment on Re: Parens mess up regex substitute
Select or Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others chilling in the Monastery: (13)
As of 2015-07-31 08:55 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (276 votes), past polls