There are 3 numbers allowed 10,20,35
You need to make a regular expression so that any combination of these numbers is appropriate, that is:
10,20,35; 35,10,20; 20,35,10; etc.
Tell me, please, what will this regular expression look like?
There are 3 numbers allowed 10,20,35
You need to make a regular expression so that any combination of these numbers is appropriate, that is:
10,20,35; 35,10,20; 20,35,10; etc.
Tell me, please, what will this regular expression look like?
The most correct in this situation would be to use backreference to remove from the match already matched alternatives.
(10|35|20),(?!\1)(10|35|20),(?!\1|\2)(10|35|20) or more beautiful entry form:
(10|35|20),(?!\1)((?1)),(?!\1|\2)((?1)) ^(10|20|35)([\\,])(10|20|35)([\\,])(10|20|35)$ Source: https://ru.stackoverflow.com/questions/349815/
All Articles