The currently proposed regular expressions use the \dmeta character, which is nowadays usually matching digits in the Unicode sense. So it does not only match ASCII 0-9, but also something like Devanagiri digits.
As this is obviously wrong just use plain old [0-9]instead.
Originally created by @rammi62 on GitHub (Dec 27, 2021).
Original GitHub issue: https://github.com/semver/semver/issues/788
The currently proposed regular expressions use the `\d`meta character, which is nowadays usually matching digits in the Unicode sense. So it does not only match ASCII 0-9, but also something like [Devanagiri digits](https://en.wikipedia.org/wiki/Devanagari_numerals).
As this is obviously wrong just use plain old `[0-9]`instead.
@wyattscarpenter commented on GitHub (Jul 14, 2026):
It seems like about half of the flavors on regex101.com are willing to accept 1६.2.3 as a match for the semver regex, and half are not. As this seems undesirable, I agree that [0-9] should be used instead. Especially because, eg, ६.2.3 is never accepted.
It's also crazy to me that things would disagree about what \d means, but here we are.
<!-- gh-comment-id:4964822856 -->
@wyattscarpenter commented on GitHub (Jul 14, 2026):
It seems like about half of the flavors on regex101.com are willing to accept `1६.2.3` as a match for the semver regex, and half are not. As this seems undesirable, I agree that `[0-9]` should be used instead. Especially because, eg, `६.2.3` is never accepted.
It's also crazy to me that things would disagree about what `\d` means, but here we are.
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Originally created by @rammi62 on GitHub (Dec 27, 2021).
Original GitHub issue: https://github.com/semver/semver/issues/788
The currently proposed regular expressions use the
\dmeta character, which is nowadays usually matching digits in the Unicode sense. So it does not only match ASCII 0-9, but also something like Devanagiri digits.As this is obviously wrong just use plain old
[0-9]instead.@wyattscarpenter commented on GitHub (Jul 14, 2026):
It seems like about half of the flavors on regex101.com are willing to accept
1६.2.3as a match for the semver regex, and half are not. As this seems undesirable, I agree that[0-9]should be used instead. Especially because, eg,६.2.3is never accepted.It's also crazy to me that things would disagree about what
\dmeans, but here we are.