A regular expression that can match a valid JSON number.
A regular expression that can match a valid JSON number. This has 4 match groups:
The negative sign, fractional part and exponent part are optional matches
and may be null
.
Parses a JSON number from a string.
Parses a JSON number from a string. A String is valid if it conforms to
the grammar in the JSON specification (RFC 4627 -
http://www.ietf.org/rfc/rfc4627.txt), section 2.4. If it is valid, then
the number is returned in a Some
. Otherwise the number is invalid and
None
is returned.
a JSON number encoded as a string
a JSON number if the string is valid
Returns a JsonNumber
whose value is the valid JSON number in value
.
Returns a JsonNumber
whose value is the valid JSON number in value
.
This value is **not** verified to be a valid JSON string. It is assumed
that value
is a valid JSON number, according to the JSON specification.
If the value is invalid then the results are undefined. This is provided
for use in places like a Jawn parser facade, which provides its own
verification of JSON numbers.