Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
The end result should be:$text = 'Cheese.Bacon'; $v1 = '(\w+)\.(\w+)'; $v2 = '$2\.$1'; $test =~ s/$v1/$v2/;
This is what I get:$text = 'Bacon.Cheese';
How do I get the Substitutions to work correctly.$text = '$2\.$1';
Thanks in advance.
Edit by tye, title, remove BR tags, add CODE tags
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: RegEx - Using Templetes
by Zaxo (Archbishop) on May 29, 2003 at 02:48 UTC | |
by Anonymous Monk on May 29, 2003 at 13:19 UTC | |
|
Re: RegEx - Using Templetes
by Enlil (Parson) on May 29, 2003 at 02:54 UTC | |
|
Re: RegEx - Using Templates
by VSarkiss (Monsignor) on May 29, 2003 at 02:44 UTC |