http://www.perlmonks.org?node_id=1039821


in reply to RegEx Headaches

You can do
@numbers = /(\d+)(?=\.)(?=.*\.xml$)/g
This uses lookahead, which will match the rest of the string, but not consume it.

If you don't need the extra check, you can just do

@numbers = /(\d+)/g