Jaylene5189 Jaylene5189
  • 20-07-2019
  • Computers and Technology
contestada

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

Respuesta :

Branta Branta
  • 31-07-2019

Answer:

[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}

Answer Link

Otras preguntas

How many electrons will metals generally have in their outer shell?
The ability to apply the findings from one study to a broader population is called _____.
According to President Roosevelt, why was Japan’s attack on Pearl Harbor such a surprise?
How to get rid of permanent marker on couinter?
A tear in the abdominal wall that allows part of the intestine to push through
What is the density of a 700 kg object with a volume of 649 m^3
Why is Still Life – Le Jour by Georges Braque an example of Synthetic Cubism?
Which majority branch of Islam believes that leaders who followed Muhammad did not have to be blood related to muhammed's clan?
Rationalize the numerator or denominator, and simplify: (∛(x+h)-∛x)/h File of problem is attached
Why does pakistans possession of nuclear weapons concern the United States