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)%$
You can make it a bit shorter:
^([1-9][0-9]?|100)%$
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With