Slightly simplified regex of @aelor
^(?:36[0]|3[0-5][0-9]|[12][0-9][0-9]|[1-9]?[0-9])?$
Pregunta
I am trying to find regular expression for my project. The regular expression should either accept values between 0 and 360 or empty(null) value.
Solución
Slightly simplified regex of @aelor
^(?:36[0]|3[0-5][0-9]|[12][0-9][0-9]|[1-9]?[0-9])?$
Otros consejos
you need this:
^(?:\s*|0|(?:36[0]|3[0-5][0-9]|[12][0-9][0-9]|[1-9][0-9]|[1-9]))$