in reply to Grabbing numbers from a URL
Did you try changing \d{4} to \d{4,5}?
m[(\d{4,5})\.htm] and print $1 for qw[ xxx1234.htm xxxx12345.htm ];; 1234 12345
If you need to exclude urls that might contain more than 4 or 5 digits:
m[(?<=\D)(\d{4,5})\.htm] and print $1 for qw[ xxx123.htm xxx1234.htm x +xxx12345.htm xxx123456789.htm ];; 1234 12345
|
|---|