\Astart of string
\s*a Unicode whitespace character, repeated any number of times
Comment: optional whitespace at the start,
Group sign(?P<sign>[-+]?) ?matches at most one character from the set below:
-the literal - (4510 / 558 / 2D16)
+the literal + (4310 / 538 / 2B16)
Comment: an optional sign, then
Positive Lookahead(?=\d|\.\d) \da Unicode decimal digit
\.the literal . (4610 / 568 / 2E16)
\da Unicode decimal digit
Comment: lookahead for digit or .digit
Group num(?P<num>\d*|\d+(_\d+)*) \d*a Unicode decimal digit, repeated any number of times
2nd Alternative\d+(_\d+)* \d+a Unicode decimal digit, repeated at least once
*repeats the group contents below any number of times:
_the literal _ (9510 / 1378 / 5F16)
\d+a Unicode decimal digit, repeated at least once
Comment: numerator (possibly empty)
Non-Capturing Group(?: # followed by
(?:\s*/\s*(?P<denom>\d+(_\d+)*))? # an optional denominator
| # or
(?:\.(?P<decimal>d*|\d+(_\d+)*))? # an optional fractional part
(?:E(?P<exp>[-+]?\d+(_\d+)*))? # and optional exponent
) 1st Alternative # followed by
(?:\s*/\s*(?P<denom>\d+(_\d+)*))? # an optional denominator
Comment: followed by
Non-Capturing Group(?:\s*/\s*(?P<denom>\d+(_\d+)*))? ?repeats the group contents below at most once:
\s*a Unicode whitespace character, repeated any number of times
/the literal / (4710 / 578 / 2F16)
\s*a Unicode whitespace character, repeated any number of times
Group denom(?P<denom>\d+(_\d+)*) \d+a Unicode decimal digit, repeated at least once
*repeats the group contents below any number of times:
_the literal _ (9510 / 1378 / 5F16)
\d+a Unicode decimal digit, repeated at least once
Comment: an optional denominator
2nd Alternative # or
(?:\.(?P<decimal>d*|\d+(_\d+)*))? # an optional fractional part
(?:E(?P<exp>[-+]?\d+(_\d+)*))? # and optional exponent
Comment: or
Non-Capturing Group(?:\.(?P<decimal>d*|\d+(_\d+)*))? ?repeats the group contents below at most once:
\.the literal . (4610 / 568 / 2E16)
Group decimal(?P<decimal>d*|\d+(_\d+)*) d*the literal d (10010 / 1448 / 6416) (case sensitive), repeated any number of times
2nd Alternative\d+(_\d+)* \d+a Unicode decimal digit, repeated at least once
*repeats the group contents below any number of times:
_the literal _ (9510 / 1378 / 5F16)
\d+a Unicode decimal digit, repeated at least once
Comment: an optional fractional part
Non-Capturing Group(?:E(?P<exp>[-+]?\d+(_\d+)*))? ?repeats the group contents below at most once:
Ethe literal E (6910 / 1058 / 4516) (case sensitive)
Group exp(?P<exp>[-+]?\d+(_\d+)*) ?matches at most one character from the set below:
-the literal - (4510 / 558 / 2D16)
+the literal + (4310 / 538 / 2B16)
\d+a Unicode decimal digit, repeated at least once
*repeats the group contents below any number of times:
_the literal _ (9510 / 1378 / 5F16)
\d+a Unicode decimal digit, repeated at least once
Comment: and optional exponent
\s*a Unicode whitespace character, repeated any number of times
\Zend of string, or before its final line terminator
Comment: and optional whitespace to finish
x modifier: extended. Ignores unescaped whitespace and comments outside character classes
g modifier: global. Finds all matches instead of stopping after the first