Skip to main content

Variable: PY_FLOAT

const PY_FLOAT: RegExp

Defined in: src/producers/espn_basketball_box.ts:135

The strings Python float(s) accepts after stripping whitespace: decimal / exponent forms with _ digit groups, plus inf / infinity / nan (case-insensitive).

Remarks​

Test against s.trim(); the pattern itself allows no surrounding whitespace.

Example​

PY_FLOAT.test("1e3"); // true
PY_FLOAT.test("NaN"); // true