Answer the question
In order to leave comments, you need to log in
pattern attribute. How to correctly form the necessary expression?
A list of standard and non-standard expressions can be found here:
and here.
I need to formulate an expression so that only numbers can be entered in the form, a maximum of 4 characters, and if a person wants to enter 4 characters, then he could only enter " 1000 ". Not 1001 or 2100, just 1000 .
Tobish in the range of one, two, three characters, he can write any numbers from 0 to 9, but if he wants to enter 4 characters, then he needs to be able to enter only the number 1000.
I formed it, of course, but this option does not work : ^[0-9]\d[0-2]{0-4}
Tell me how to do it right?
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question