numeric-quantity - v3.3.1
    Preparing search index...

    Variable numericRegexConst

    numericRegex: RegExp = ...

    Captures the individual elements of a numeric string. Commas and underscores are allowed as separators, as long as they appear between digits and are not consecutive.

    Capture groups:

    # Description Example(s)
    0 entire match "2 1/3" from "2 1/3"
    1 sign (- or +) "-" from "-2 1/3"
    2 whole number or numerator "2" from "2 1/3"; "1" from "1/3"
    3 entire tail: fraction, decimal, and/or exponent " 1/3" from "2 1/3"; ".23" from "1.23"; ".5e3" from "1.5e3"
    4 exponent, when there is no decimal portion "e3" from "1e3"
    5 exponent, when there is a decimal portion "e-3" from "1.5e-3"
    6 numerator of a mixed number (incl. leading space) " 2" from "1 2/3"

    Groups 4–6 are subgroups of group 3 and are not used directly by numericQuantity; only groups 1–3 are consumed.

    Capture groups 2 and 3 may include comma/underscore separators.

    numericRegex.exec("1")      // [ "1",      null, "1",     null,     null, null,  null ]
    numericRegex.exec("1.23") // [ "1.23", null, "1", ".23", null, null, null ]
    numericRegex.exec("1 2/3") // [ "1 2/3", null, "1", " 2/3", null, null, " 2" ]
    numericRegex.exec("2/3") // [ "2/3", null, "2", "/3", null, null, null ]
    numericRegex.exec("2 / 3") // [ "2 / 3", null, "2", " / 3", null, null, null ]
    numericRegex.exec("-2 1/3") // [ "-2 1/3", "-", "2", " 1/3", null, null, " 1" ]
    numericRegex.exec("1e3") // [ "1e3", null, "1", "e3", "e3", null, null ]
    numericRegex.exec("1.5e-3") // [ "1.5e-3", null, "1", ".5e-3", null, "e-3", null ]
    numericRegex.exec("1,000") // [ "1,000", null, "1,000", null, null, null, null ]

    This pattern and numericRegexWithTrailingInvalid are maintained as two separate literals and must be kept in sync. They differ only in the tail: $ here versus (\s*[^.\d/].*)? there. src/index.test.ts asserts that equality.