Digits
What this is
\d is 0-9. For a full number lexer you need optional fraction and exponent.
/[+-]?\d+/gtemp -3 and 42 3.14 is two matches with this pattern
FAQ
- Unicode digits?
- With flag u, \p{Nd} matches any decimal digit, not just ASCII.
\d is 0-9. For a full number lexer you need optional fraction and exponent.
/[+-]?\d+/gtemp -3 and 42 3.14 is two matches with this pattern