Using regular expressions

Posted by Tom on Stack Overflow See other posts from Stack Overflow or by Tom
Published on 2010-05-30T10:26:33Z Indexed on 2010/05/30 10:32 UTC
Read the original article Hit count: 246

Filed under:
|
|
|

What is wrong with this regexp? I need it to make $name to be letter-number only. Now it doens't seem to work at all.

 if (!preg_match("/^[A-Za-z0-9]$/",$name)) {
  $e[]="name must contain only letters or numbers";
 }

© Stack Overflow or respective owner

Related posts about php

Related posts about regex