Next | Tricks of the Wizards | 209 |
@state_abbr = qw(AK AL AR AZ CA ... WV WY);
@state_pat = ( 'Alaska', 'Alabama', 'Arkansas', 'Ariz(?:\.|ona)?', 'Cal(?:\.|if(?:\.|ornia)?)?', ... 'W(?:est|\.)?\s*V(?:irginia|\.)?', 'Wyo(?:\.|ming)?', );
Given $input, does it match a state? Which one?
Next | Copyright © 2003 M. J. Dominus |