in reply to Re^4: How we can separate a backref from a digit?
in thread How we can separate a backref from a digit?
Unexpected to you. Variable interpolation happens before the regular expression is parsed and compiled so there is no difference between
and$a=1; print "Match\n" if "aa1" =~ /^(a)\1$a$/; # not match!
orprint "Match\n" if "aa1" =~ /^(a)\11$/; # not match!
If it did not work like this you could not build regular expressions out of parts stored in variables.$a='\11'; print "Match\n" if "aa1" =~ /^(a)$a$/; # not match!
Jenda
Enoch was right!
Enjoy the last years of Rome.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^6: How we can separate a backref from a digit?
by Serge314 (Acolyte) on Mar 21, 2011 at 10:29 UTC |