I have a string following the pattern: "aaa. bbb ccc nr. ddd23-56" where a, b, c, d are alphanum having "(aaa. bbb ccc) nr. ddd(23)-56" : I want to extract whatever is between paranteses () The word between [] can be present or not. This is what I have done and I need help with:($street, $n, $number) = ($address =~ /(.*?)(nr\.)*\b\D*(\d+)[\d\w-]+\b$/i);
The above regexp extracts $number="23" but it doesn't extract the $street. The correct results should be: $street == "aaa. bb cc" $number == "23" Thank you very much.P.S. The requirement is to do it in only one regexp
In reply to Need help with perl regexp by flaviusm
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |