When using a specific subpattern inside reg exp, it does not select the best match, but stops at the first match. Did I forget some flag?
Regular expression: (?<minutes>[0-9]|[1-5][0-9]):(?&minutes);
test string: 47:24;.
The expression does not match:

But the line is 47:2;executed correctly:
.
If I change the condition "or" to [1-5][0-9]|[0-9], reg exp (?<minutes>[1-5][0-9]|[0-9]):(?&minutes);works just fine. Is there any other way to make the string '47: 24; 'match without state change "or"?
source
share