Hi,
I'm new to javascript and regEx and trying to solve the following
problem.
I have a function which validates the password if there is a number:
-------------------------------------------------
function findNumeric(str _obj){
regEx = /\d/;
if (str_obj.match( regEx))
return true;
else
return false;
}
--------------------------------------------------
The problem arises when I put a password with a space in between e.g:
'test test1'. The fucntion returns false. I've tried '\s' in the
regEx but the user can put the space anywhere..
Any idea how to solve this problem as I should be able to put any
alplanumeric value into the password, including space.
Thanks a lot.
Vish
I'm new to javascript and regEx and trying to solve the following
problem.
I have a function which validates the password if there is a number:
-------------------------------------------------
function findNumeric(str _obj){
regEx = /\d/;
if (str_obj.match( regEx))
return true;
else
return false;
}
--------------------------------------------------
The problem arises when I put a password with a space in between e.g:
'test test1'. The fucntion returns false. I've tried '\s' in the
regEx but the user can put the space anywhere..
Any idea how to solve this problem as I should be able to put any
alplanumeric value into the password, including space.
Thanks a lot.
Vish
Comment