The following regex finds hexadecimal, octal, and decimal numbers:
((?:[+-])?(?:(?:0?\.[0-9]*)|(?:[1-9]+\.?[0-9]*))(?:[eE][+-]?(?:(?:0?\.[0-9]*)|(?:[0-9]+\.?[0-9]*)))?)|(0x[0-9a-fA-F]+)|(0[0-9]*)
Escaped ("string safe"):
((?:[+-])?(?:(?:0?\\.[0-9]*)|(?:[1-9]+\\.?[0-9]*))(?:[eE][+-]?(?:(?:0?\\.[0-9]*)|(?:[0-9]+\\.?[0-9]*)))?)|(0x[0-9a-fA-F]+)|(0[0-9]*)