[thelist] php - regexp help

Paul Bennett paul at web-business-pack.com
Thu Sep 23 16:23:46 CDT 2004


Hi 'evolters,

Having trouble formulating a regexp for credit card holders name. 
Basically I want to accept a-z (upper and lower case), spaces, full 
stops ('periods' for our US readers ;) ) and apostrophes.
I can get the first 3 to work but can't seem to get an apostrophe 
through the regexp.

This is the code:

if (!preg_match ("/^[A-Za-z \'\.]+$/", $creditcard_holder))
    {
    # alert user
    }

also any GOOD regexp resources or tutorials would be welcome, the stuff 
I have found is either too basic or too advanced....

Thanks,
Paul



More information about the thelist mailing list