0
In the address registration field, I have the zip code. In this cep field, I need to make some validations:
1 - Do not allow the user to type a sequence with two alternating numbers:
EX 1: "12121212"
EX 2: "12312312"
2 - Do not allow the user to type a sequence of a given number:
EX: "111111111"
How could I do that? I couldn’t make a regex that would handle both situations.
It will always be sequence of 2 ?
– Marlysson
can be a sequence of 3 too, is the most I will block.
– durtto
For the second example this case would enter as wrong ? "1102039020392" in relation to "11" ...
– Marlysson
I don’t want to allow strains like this: 111111111 222222 333333
– durtto
https://viacep.com.br/exemplo/javascript/
– user75204
It worked the answer I put to you @durtto ?
– Marlysson
Has any response helped solve the problem and can address similar questions from other users? If so, make sure to mark the answer as accepted. To do this just click on the left side of it (below the indicator of up and down votes).
– Sorack