Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation
 
PerlMonks  

Re: Parens mess up regex substitute

by Anonymous Monk
on Jan 26, 2012 at 04:12 UTC ( #950020=note: print w/replies, xml ) Need Help??


in reply to Parens mess up regex substitute

Because in perl's regular expression language parens have meaning, they're meta characters, specifically, they're called capturing parens. Anything matched in capturing parens, is stored in a number variable ($1,$2 ...)

see perlre, perlretut

To see how the regex engine does matching,  use re 'debug';

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://950020]
help
Chatterbox?
[LanX]: evrybody can participate in a YAPC
choroba is still undecided what to present at YAPC
[LanX]: imagine the stock market if the choice for the second round would have been those two ...
[robby_dobby]: LanX: Not me. No YAPC in my country and the only one in Asia is so far off in Japan
[LanX]: Oh I thought "Misery" meant Missoury
[LanX]: where do you live?
[LanX]: YAPC Asia was renamed and you'd need to speak Japanese to be able to follow
[robby_dobby]: LanX: Misery :P
[robby_dobby]: Or India
LanX which means I can finally organize YAPC Asia in Sharm el Sheikh ;-)

How do I use this? | Other CB clients
Other Users?
Others browsing the Monastery: (12)
As of 2017-04-24 15:57 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    I'm a fool:











    Results (442 votes). Check out past polls.