kevyt has asked for the wisdom of the Perl Monks concerning the following question:
I know that this must be easy but I can't think of a regular expression that will extract the zip code from the line below:
UPDATE: Someone helped. This works.</State><Zip>81919-9814</Zip><Country>US</Country>
$s = '</State><Zip>81919-9814</Zip><Country>US</Country>'; print "before = $s\n"; $s =~ /<Zip>(.*?)<\/Zip>/; print "after = $1\n";
Back to
Seekers of Perl Wisdom