I’m trying to write a regular expression for strings that are numbers in JSON. I’m still new to writing Regular expressions, I found a diagram of a machine for JSON numbers here , but I’m not sure how to attack it.
Here are some strings that should be found by the regex.
“22”,
“55.75466”,
“-44.565”
“55e-2”
“69234.2423432 E78”
Any help is appreciated!
For reference, here’s the “number” diagram from http://www.json.org/fatfree.html:
The regex that should match this is: