\d
is called a character class and will match digits. It is equal to [0-9]
.
+
matches 1 or more occurrences of the character before.
So \d+
means match 1 or more digits.
\d is a digit, + is 1 or more, so a sequence of 1 or more digits
\d
means 'digit'. +
means, '1 or more times'. So \d+
means one or more digit. It will match 12
and 1
.
Source: Stackoverflow.com