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]*$/ Link to comment https://forums.phpfreaks.com/topic/94824-need-pattern-changed-with-no-space/ 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. Link to comment https://forums.phpfreaks.com/topic/94824-need-pattern-changed-with-no-space/#findComment-485772 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.