Beefy Boxes and Bandwidth Generously Provided by pair Networks
Come for the quick hacks, stay for the epiphanies.
 
PerlMonks  

Re^3: Difference between $1 and \1. (perldoc -v)

by rbala (Acolyte)
on Dec 27, 2012 at 14:08 UTC ( [id://1010532]=note: print w/replies, xml ) Need Help??


in reply to Re^2: Difference between $1 and \1. (perldoc -v)
in thread Difference between $1 and \1.

Thanks all! From your replies I understand that $1 , $2 type of variables will not contain any value or contain only, old match values of first or second paranthesis from any previous regex matching , unless the pattern matching is complete and if that matching is successful. Opposed to this is \1 which stores first paranthesis value even before the entire pattern is matched , so that it has a defined value in the matching pattern itself and hence provides expected results. Hope my understanding is correct. Correct me if any concerns for you...!!!
  • Comment on Re^3: Difference between $1 and \1. (perldoc -v)

Replies are listed 'Best First'.
Re^4: Difference between $1 and \1. (perldoc -v)
by Anonymous Monk on Dec 27, 2012 at 14:11 UTC
    correct!

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others surveying the Monastery: (4)
As of 2024-04-19 04:51 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found