Re: [PHP] preg_match question

2004-07-21 Thread John Van Pelt
Thank you both Jason and Curt... Looks like I was pretty close... In fact, I found a fault in my logic, too, that meant only some but not all instances of $element were being validated, even after i got the preg function right! But it's all working great now. - john As John has previously

[PHP] preg_match question

2004-07-20 Thread John Van Pelt
I am a semi-newbie at php and a complete newbie to regex What am I doing wrong here? function isWord($element) { return !preg_match (/[^A-Za-z\-\(\)\s]/, $element); } I want to test the string $element and make sure that it contains nothing but: - characters A-Z - characters a-z