more useful options | |
PerlMonks |
Re^3: Unnecessary use of capturing in regex?by gothic_mallard (Pilgrim) |
on Nov 03, 2004 at 13:40 UTC ( [id://404888]=note: print w/replies, xml ) | Need Help?? |
They give the same output because they are still technically the same. The only difference is the parenthesis in the regex around the "any single character" ( or "." ). The role of parenthesis here is to group parts of the regex together and to create back references ($1, $2 etc). See the perlre documentation for full details on what it does. In this particular case it's making no difference to the operation of the regex in question. All code is untested unless otherwise stated.
In Section
Seekers of Perl Wisdom
|
|