What input string will the following regex expression match:
[1-4]{0-5}
I know the first part: [1-4] specifies the numerals allowed in the input, and the latter the length? But it does not match any of the expected inputs, such as 1112, 123.. 
What input string will the following regex expression match:
[1-4]{0-5}
I know the first part: [1-4] specifies the numerals allowed in the input, and the latter the length? But it does not match any of the expected inputs, such as 1112, 123.. 
 
    
    Try the following regex,
It should be :
[1-4]{0,5}
This will match:
empty string  = because {0,5} means zero to 5 length of character
1
11
111
1111
11111
2
22
2222
1
12
1234
12344
and it goes on and on but nothing beyond the digit 4, and no length beyond 5
 
    
    The latter is not the length. If it were the length, it would be {0,5} with a comma instead of a -.
Without the comma, it will just match {0-5} literally, so this matches:
1{0-5}
I think you want
[1-4]{0,5}
