\d
in a regex isn't always equal to [0-9]
Published on in JavaScript and Regular expressions
In JavaScript, \d
and [0-9]
are equal and match only Arabic numerals (the numbers 0–9).
But in some other languages, \d
matches also non-Arabic numerals.