my ($street, $number) = $address=~/ ^(.+?) # capture street name \s+ # ignore following whitespace (?:nr\.\s*){0,1} # ignore optional "nr." and trailing whitespace \w+? # ignore alphanumerics which come before... (\d+) # capture digits followed by... -\d+ \s* $ # ignore a hyphen, extra digits and end of line /x;