6
Situation:
I have a page that contains a <iframe>
another, on this other page, I have a simple HTML element input
:
<input type="text" required="" pattern="[a-Z]{2,35}" tabindex="6" name="edtCidade" id="edtCidade">
I am sure and have made sure that there is no event assigned to it or code changing its properties.
However, every time I type, any key, can be number, can be letter, anything, every time I type generates this error in the console:
Syntaxerror: invalid range in Character class
Example:
If I type "az123" I will have 5 errors SyntaxError
in my browser console.
Important:
This mistake does not cause me any problem, it is insignificant but it is bothering me, and I would like to know the origin of it.
Question:
How to resolve this error? Why is it occasioned? I would like a detailed explanation.
Just to complement the
\w
magpie[a-zA-Z0-9_]
– Leandro Amorim
It’s true, I’ve corrected it. Thank you!
– Rodrigo Rigotti
The correct standard to be used in place of the
[a-Z]{2,35}
invalid would be[A-z]{2,35}
corresponding, in table ASCII, to the interval 65 to 122. However, as Master Aurelius said:Não use o intervalo A-z, prefira A-Za-z
, this because this range covers six other characters, namely: [ ] _ ` which without due caution may be a problem for the Application.– Bruno Augusto