Doubt about regular expression | digital

Doubt about regular expression | digital
0.0 0

#1

In this lesson : https://www.freecodecamp.org/challenges/find-numbers-with-regular-expressions
Why would we need a + if /d\g finds all the numbers already?


#2

\/d\g will match all the ‘istances’ of one digit.
\/d+\ will match the first ‘istance’ of one or more digit
\/d+\g will find all the ‘istances’ of one or more digit.
So, the only difference i can see is that you will have two match in " 34 and 5" (34, 5) using the last option, three match if you use the first one( 3, 4, 5).
About the challenge i think it makes no difference ^^
Hope it helps,
-LyR-


#3

Thank you so much!!!