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