Re: regular exp if help
| From: | Monte Ohrt | Date: | Wed, 23 Aug 2000 21:35:56 +0000 |
| Subject: | Re: regular exp if help | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-13227@lists.php.net to get a copy of this message | ||
preg style:
if(!preg_match("/^[\w\d]+$/",$username))
exit();
Chris Murley wrote:
>
> Hi all, i have a string containing my name
>
> $string = "chris";
>
> I want to check $string to see if contains any characters other that
> 0-9a-zA-Z and if it does, exit.
>
> I'm not too good with php reg exps, can someone post some example code?
>
> Thanks
>
> Chris
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net
> For additional commands, e-mail: php-general-help@lists.php.net
> To contact the list administrators, e-mail: php-list-admin@lists.php.net
--
Monte Ohrt <monte@ispi.net>
http://www.ispi.net/