Hi. I'm having some problems with a method that checks names (e.g First name, Last name) with preg_match(). The pattern I'm using now is ([[:digit:]]|[~`!@#$%^*()_=+{}|\:;"/?,]|[|]|)+';//#^_+=:;()[]<>{}%#$?!\\/0-9]$/';. I'm trying to look for invalid characters but something is wrong because it always return false.
The syntax for patterns used in these functions closely resembles Perl. The expression should be enclosed in the delimiters, a forward slash (/), for example. Any character can be used for delimiter as long as it's not alphanumeric or backslash (\). If the delimiter character has to be used in the expression itself, it needs to be escaped by backslash. Since PHP 4.0.4, you can also use Perl-style (), {}, [], and <> matching delimiters.