Hello,
I'm trying to abbreviate ordinals(?) that occur only in the middle of
an address and I'm having a problem. The line below works:
$test_data =~ s/(\S) North (\S)/$1 N. $2/i;
however, if the address is something like 901 North St., it abbreviates that as
well. I'm wanting it to work only on an address like
53 North Benson St. -> 53 N. Benson St.
Is there a way to know whether or not 'North' is a street name as
opposed to a direction, or am I asking too much? I was thinking of counting
the number of "words" between "North' and 'St.' (and if it's zero then don't do
it), but I wouldn't know how to do that or even if that's the best way to do it.
Thanks!
Angela
--
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]
http://learn.perl.org/