the regex does not allow comma for me
Posted: Mon May 15, 2006 4:14 am
I am trying to allow a few characters in a pattern match and I want to allow comma as well. I am trying to escape comma since it is a special character but the regex engine does not seem to accept.
Code: Select all
preg_match("#[^a-zA-Z0-9\s\.-\,]#", $_POST['city'])
error: Warning: preg_match() [function.preg-match]: Compilation failed: range out of order in character class at offset 17