Answer the question
In order to leave comments, you need to log in
Why does the regex rule give this result?
Why does the rule /\d\d/g match only the first two values 100/100, i.e. the value 10 and 10. The
question is why not 100 and 100, because /d is any number from 0 to 9 inclusive.
By idea 1 matches
0 matches
0 matches
Slash does not match
1 matches
0 matches
0 matches
Answer the question
In order to leave comments, you need to log in
Idea 1 matcheswhat does it match? with search
\цифра\цифра
? No, it doesn't match. C \d\d
matches 10. 1 matchesthen just
0 matches
0 matches
Slash does not match
1 matches
0 matches
0 matches
/\d/g
Your regexp is humanly read like this: "two consecutive digits".
Such an expression cannot coincide with three digits at once, because two, not three, are needed.
If the question is why "23" and "56" do not match in "123/456", it is because 2 and 5 have already been caught (missed) in "12" and "45" and therefore are no longer considered.
If you search for the same regexp in "1234/5678", you will find "12", "34", "56", "78".
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question