Regex match numerical range
-
01-10-2019 - |
Pergunta
I am trying to write a simple regex to match a percentage value range 1%-100%
Is there a better way to write this?
^([1-9]|[1-9][0-9]|100)%$
Solução
You can make it a bit shorter:
^([1-9][0-9]?|100)%$
Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow