The $n is not needed ...
then the whole expression may be written more compact:
... my ($street, $number) = $address =~ /(.+?) # first grou +p (?:\s+ nr \.)? # any number + prefix? \s+ [A-z]+ (\d+) # number fol +lows alpha /xi; print "STREET: $street, NUMBER: $number\n"; ...
(although it might backtrack more now ;-)
Regards
mwa
In reply to Re^3: Need help with perl regexp
by mwah
in thread Need help with perl regexp
by flaviusm
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |