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

With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'
Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
"Science is about questioning the status quo. Questioning authority". The enemy of (IT) success is complexity.
In the absence of evidence, opinion is indistinguishable from prejudice. Suck that fhit