[thelist] [php] '*' inside regexp (preg_match)

Paul Bennett Paul.Bennett at wcc.govt.nz
Tue May 29 16:29:02 CDT 2007


Hi people smarter than me,

Discalimer: I'm a regexp retard (but I am getting better). In any case, can someone tell me why this returns true?:

echo preg_match("/^[a-zA-Z0-9 -.(),]+$/", 'abc**def'); 

Surely the regexp shouldn't allow the asterisk character to be in there??? Or does it have special meaning when used as a string inside preg_match?

Confusedly yours,
Paul 



More information about the thelist mailing list