How can I display a list of characters that fail to match a regular expression?
- by Matt
For example, if I'm doing some form input validation and I'm using the following code for the name field.
preg_match("/^[a-zA-Z .-]$/", $firstname);
If someone types in Mr. (Awkward) Double-Barrelled I want to be able to display a message saying Invalid character(s): (, )