i have this function:
------------------------------------------------------------
function isAlfaNumeric(v nos,space) {
if (space==false) {
validRegExp = /^[a-zA-Z0-9]{0,}$/;
}
else {
validRegExp = /^[a-zA-Z0-9\s]{0,}$/;
}
return vnos.search(val idRegExp)
}
-------------------------------------------------------------
the function is checking if the string "vnos" contains any non-alfanumeric
characters... it works fine except it returns true if the string contains
my country characters like ž,š.....i tried to do the following
validRegExp = /^[a-zA-Z0-9žš]{0,}$/; and also
validRegExp = /^[a-zA-Z0-9\ž\š]{0,}$/; but result was the same
Does anyone know how to check for foreign characters in string using regular
expression??
------------------------------------------------------------
function isAlfaNumeric(v nos,space) {
if (space==false) {
validRegExp = /^[a-zA-Z0-9]{0,}$/;
}
else {
validRegExp = /^[a-zA-Z0-9\s]{0,}$/;
}
return vnos.search(val idRegExp)
}
-------------------------------------------------------------
the function is checking if the string "vnos" contains any non-alfanumeric
characters... it works fine except it returns true if the string contains
my country characters like ž,š.....i tried to do the following
validRegExp = /^[a-zA-Z0-9žš]{0,}$/; and also
validRegExp = /^[a-zA-Z0-9\ž\š]{0,}$/; but result was the same
Does anyone know how to check for foreign characters in string using regular
expression??
Comment