Difference between regex quantifiers plus and star

The * quantifier matches zero or more occurences.

In practice, this means that

\d*

will match every possible input, including the empty string. So your regex matches at the start of the input string and returns the empty string.

Leave a Comment