darkfreaks Posted March 7, 2008 Share Posted March 7, 2008 need the following pattern to disallow all whitespace /^[a-zA-Z\x7f-\xff][a-zA-Z0-9\x7f-\xff]*$/ Quote Link to comment Share on other sites More sharing options...
fnairb Posted March 7, 2008 Share Posted March 7, 2008 If you need it to have at least one of those characters change the * to a + If it has to have any one or more non space character wouldn't the following work: /^\S+$/ If it has to have any zero or more non space character wouldn't the following work: /^\S*$/ It is easier to figure out a pattern when you know what you are looking for as well as what you are trying not to find. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.