Basilides has asked for the wisdom of the Perl Monks concerning the following question:
Take the word "ai(=ma" (haema-, blood). I'd like to use a regex to match the stem, "ai(=m-", to, say, the genitive singular,
"ai(=matos". Should be simple:
but everything keeps bumming out because of the special keys, which I don't want to be read as special keys (except the caret at the start). How can I keep my caret, and then have all /, \, ( and ) characters taken at face value?if ($word =~ m/^$stem/) {blah;}
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Escaping in regexes
by kvale (Monsignor) on Jun 28, 2002 at 00:02 UTC | |
|
Re: Escaping in regexes
by Hofmator (Curate) on Jun 28, 2002 at 10:16 UTC |