in reply to Idiom for a regex translation
use Regexp::Common 'pattern'; pattern name => ['squish'], create => '\W+'; my $name = "Rob J Anderson"; my $squished_name; $squished_name = $RE{squish}->subs($name); # Following only needed because of /g: $squished_name = $RE{squish}->subs($squished_name) while $RE{squish}->matches($squished_name);
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Idiom for a regex translation
by reasonablekeith (Deacon) on Apr 22, 2005 at 15:31 UTC |