From: [EMAIL PROTECTED]
> Jenda Krynicky writes:
>  > I'd do it like this :
>  > 
>  > # set up the mapping
>  > %replace = (
>  >    Boulevard => 'Blvd',
>  >    Street => 'St',
>  >    Drive => 'Dr',
>  >    Avenue => 'Ave',
>  >    Circle => 'Cir',
>  > );
>  > 
>  > # prepare the regular expression
>  > $regexp = join '|', keys %replace;
>  > $regexp = qr/\b(?:$regexp)\b/i;
> 
> Surely you want to capture the matching string so that it can be used
> in the replacement expression, i.e.
> 
> $regexp = qr/\b($regexp)\b/i;

Whoops. Sorry, sure.

[rem]
Jenda, as a punishment you'll write one hundred times "I shall never 
post untested code!".
[/rem]

Jenda
=========== [EMAIL PROTECTED] == http://Jenda.Krynicky.cz ==========
There is a reason for living. There must be. I've seen it somewhere.
It's just that in the mess on my table ... and in my brain
I can't find it.
                                        --- me

_______________________________________________
ActivePerl mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

Reply via email to