Como obter apenas alfanumérico e espaço em branco em String regex
/[A-Za-z\d\s]/g
Saurabh Zinjad
/[A-Za-z\d\s]/g
var regex = new RegExp("^[A-Za-z0-9? ,_-]+$");
var key = String.fromCharCode(event.charCode ? event.which : event.charCode);
if (!regex.test(key)) {
event.preventDefault();
return false;
}
def isAlphaNumericStr(text):
if(re.match("^[A-Za-z0-9 -]+$", text) != None):
return True
root.bell()
return False
#TO ACTIVATE ON FIELD
txtCustomerName.configure(validate="key", validatecommand = (txtCustomerName.register(isAlphaNumericStr),'%P'))
Emerald j