can i somehow compare two numbers in regex? i want regex that is correct for 10-12, but incorrect for 12-10. I mean that 10 must be smaller than 12. I want to do it in Javascript.
If the input is always of the form X-Y, then why not use the split() function with '-' as the delimiter and then compare the two parts with >
You can't compare numerical values using RegExps.
2.1m questions
2.1m answers
60 comments
57.0k users