javascript regex for username code example Example: javascript regex for usernames var usernameRegex = /^[a-zA-Z0-9]+$/;