in reply to Allow empty form fields regex
Then I took a good look at you regexp. You are accepting any of a class of characters, one or more times. To accept an empty field as well, simply change the + to *:
It's not a general answer, but in your particular case, it should work.if ($contents != /^[\w \.\,\=\" \/<>]*$/ ){ $contentserror = "Error - message.";++$error; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Allow empty form fields regex
by Hissingsid (Sexton) on Mar 18, 2004 at 16:55 UTC | |
by Hissingsid (Sexton) on Mar 18, 2004 at 17:18 UTC |