Khatri has asked for the wisdom of the Perl Monks concerning the following question:
Although I know I can do s/\babc\b/\bx\b/g; but is it possbile using $variables as shown above?$t = "abc"; $b = "x"; $l = "xyzabcdef"; $l =~ s/can I use $t here ? /can I use $b here ?/g;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Can I Use Variables In A Regex?
by jZed (Prior) on Oct 30, 2005 at 00:52 UTC | |
|
Re: Can I Use Variables In A Regex?
by pg (Canon) on Oct 30, 2005 at 02:33 UTC | |
|
Re: Can I Use Variables In A Regex?
by dragonchild (Archbishop) on Oct 30, 2005 at 02:12 UTC | |
by dave_the_m (Monsignor) on Oct 30, 2005 at 10:28 UTC |