2
Hello, everyone. Next, I am making a regular expression to accept the following: 02 word. Word and numbers, not just numbers. I’m using this code:
$(".inputNomeTurma").keyup(function() {
var valor = $(this).val().replace(/(([a-zA-Z]*\d{3,})|[!"#$%&'()*+ºª,-./:;<=>?@[\]_{|}])/,'');
$(this).val(valor);
});
It is ok, if I click a * character for example, it replaces it. But if I press and hold *, the field accepts the special character.
Being very simple add the character
g
at the end of its regex/REGEX/g
, whether it works.– Guilherme Lautert
I didn’t quite understand but see if this is it https://regex101.com/r/sU8fF3/3
– Marcos Xavier