Ask Question
8 November, 08:45

What is a regular expression that would match any digit 1-999?

+5
Answers (1)
  1. 8 November, 09:05
    0
    [1-9][0-9]{0,2}

    Explanation:

    The numbers to be matched consist of three digits with the following requirements:

    - Digit 1 can take the values 1-9

    - Digit 2 can take the values 0-9

    - Digit 3 can take the values 0-9

    - Digits 2 and 3 are optional, that is the number may consist of 1,2 or 3 digits in all.

    Taking these into account, the overall regular expression can be represented as follows:

    [1-9][0-9]{0,2}
Know the Answer?
Not Sure About the Answer?
Find an answer to your question ✅ “What is a regular expression that would match any digit 1-999? ...” in 📘 Computers and Technology if you're in doubt about the correctness of the answers or there's no answer, then try to use the smart search and find answers to the similar questions.
Search for Other Answers