My JavaScript code checks if the username meets certain criteria.
// Check the username
re = /^\w+$/;
if(!re.test(form.username.value)) {
alert("Alert");
form.username.focus();
return false;
}
Currently, the script only accepts letters, numbers, and underscores. I also want to allow dots and whitespaces.
Can anyone help me figure out what changes I need to make in /^\w+$/
to accept dots and whitespaces?