in reply to Turn Hate Mail to Love Letter: Regex Multi-Word/Phase Replace
as a first try? Won't work with quotes in the replacement, but that's an easy one ;-): : $profane{qr/piss (us|you) off/i} = 'lift $1 off'; : : : : $text =~ s/($profanity)/eval '"'.$profane{$1}.'"'/ge; : :
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Turn Hate Mail to Love Letter: Regex Multi-Word/Phase Replace
by chunlou (Curate) on Jun 25, 2003 at 12:21 UTC | |
by Skeeve (Parson) on Jun 26, 2003 at 06:22 UTC | |
by chunlou (Curate) on Jun 26, 2003 at 06:40 UTC | |
by Skeeve (Parson) on Jun 26, 2003 at 07:40 UTC | |
by chunlou (Curate) on Jun 26, 2003 at 10:20 UTC |