in reply to Regex help/condensation
The \b will make it match on word boundaries.my %def = ('triangles?' => '?'); s/\s+$//; # trailing s/^\s+//; # leading s/\s+/ /g; # multiple spaces to a single space s/\b$i\b/$def{$i}/gi;
Updated: fixed stupid mistake...
gav^
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Regex help/condensation
by Kanji (Parson) on Feb 15, 2002 at 04:43 UTC |