RE: [PHP] Regex validation
| From: | Boyd, Todd M. | Date: | Tue, 28 Oct 2008 21:35:23 +0000 |
| Subject: | RE: [PHP] Regex validation | ||
| References: | 1 2 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-282539@lists.php.net to get a copy of this message | ||
> -----Original Message-----
> From: richard.heyes@gmail.com [mailto:richard.heyes@gmail.com] On
> Behalf Of Richard Heyes
> Sent: Tuesday, October 28, 2008 4:30 PM
> To: VamVan
> Cc: php List
> Subject: Re: [PHP] Regex validation
>
> > Hello Team of Nerds,
>
> Not the best way to start your request for help.
>
> > I need help in writing a regular expression for this:
> >
> > invalid character set is:
> >
> >
>
INVALID_STRING={"/","*","+","(",")","'\'","<",">",",",":",";","~","..",
> ".@","@."};
> >
> > I want to a pregmatch for these characters on my whole email address
> and if
> > match is found I need to return false.
>
> Based on what you've said, you might not need a regex, there may well
> be an str* function that you can use. Maybe strpos().
I thought so at first, but it appears the final 3 array members of
INVALID_STRING are two characters wide. That could, of course, be
handled with a different algorithm from the other, one-character
members.
Todd Boyd
Web Programmer