Should match any valid JavaScript number literal.
Allow _
as a numerical separator, leading/trailing dot and 0
, and test for prefix 0b
(binary), 0o
(octal), and 0x
(hexadecimal).
See the second paragraph of EDIT 4
in this StackOverflow answer by me for matching JS numbers.