in reply to double deference a variable

The above are very true, one thing they did not cover is your regex, it will match digits only. So I would assume you never have floating point numbers, or numbers in other bases, or anything except a decimal, and overflow isn't a problem?

If any of this is a concern you can check out this post to fix/modify some of these concerns:
Extract numbers in multiple bases, just ignore the non-technical posts......
I don't know of an elegant way to detect overflow, but there has to be one :)

Hope Helping I do.