Re: What am i doing wrong :\
| From: | Wendell Brown | Date: | Mon, 12 May 2003 19:09:31 +0000 |
| Subject: | Re: What am i doing wrong :\ | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-147335@lists.php.net to get a copy of this message | ||
On Mon, 12 May 2003 13:25:23 EDT, Clivus2k1@aol.com wrote:
> if (preg_match("[a-zA-Z0-9_]",$text)) { return 1; }
I was close.....
if (preg_match("/^[a-zA-Z0-9_]+$/",$text)) { return 1; }
the / starts and ends Perl Regular Expressions,
the ^ says start looking at the beginning of the string,
the $ says look to the end of the string,
the + says one of more of the []'s