Beefy Boxes and Bandwidth Generously Provided by pair Networks
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??


in reply to Re^2: Unnecessary use of capturing in regex?
in thread Unnecessary use of capturing in regex?

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.

--- Jay

All code is untested unless otherwise stated.
All opinions expressed are my own and are intended as guidance, not gospel; please treat what I say as such and as Abigail said Think for yourself.
If in doubt ask.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others having an uproarious good time at the Monastery: (2)
As of 2024-04-24 22:50 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found