regex newbie question
| From: | David Pratt | Date: | Wed, 23 Oct 2002 17:51:24 +0000 |
| Subject: | regex newbie question | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-121139@lists.php.net to get a copy of this message | ||
Hoping someone can help with something probably quite simple
I am using regex to validate user input this way:
if (ereg ("^[a-zA-Z0-9\s]+$", $field)) {
$field_validate = TRUE;
}
I am trying to get the expression to accept upper or lower case letters and
numbers and also allow spaces. It works when I test the expression at
http://regexlib.com/RETester.aspx but I can't
seem to get it to work with
expressions with white space between words or numbers. Anyone have an easy
fix?
Thanks