in reply to Make a variable safe for a regex.
You want \Q and \E as indicated on perlre. They're perhaps a little obscure and arcane, but powerful and awesome.
$Title =~ s,^\Q$Artist\E\s*-\s*,,ig;
-Paul
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Make a variable safe for a regex.
by exodist (Monk) on Feb 25, 2007 at 22:27 UTC | |
|
Re^2: Make a variable safe for a regex.
by Sixtease (Friar) on Feb 28, 2007 at 22:15 UTC | |
by Corion (Patriarch) on Mar 03, 2007 at 18:53 UTC |