0

I am using below validation expression to check for number range between 0-100. I would like to extend the check to also allow for exception of 999 (default value).

   reMatch(value,"^[0-9][0-9]?$|^100$")

Thanks in advance for your help!

1
  • is 00 or 05 valid? Commented Dec 3, 2019 at 13:40

2 Answers 2

1

You can use:

   reMatch(value,"^[0-9][0-9]?$|^100$|^999$")
Sign up to request clarification or add additional context in comments.

1 Comment

No need to repeat the anchors so many times ^([0-9][0-9]?|100|999)$
1

Better use this: ^[0-9][0-9]?$|^(100|999)$

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.