$rex = \'/^[^<,\"@?=>|;#]$/i\';
I\'m having trouble with this regular expression. The idea is that the input fields are checked for certain chara
You have the $
after your expression and the ^
in the beginning, which means you are accepting exactly one character.
EDIT (based on the comments):
You can try to see if your input fields only have valid characters, by matching it against this (if it matches, it means there are no invalid characters):
$rex = '/^[^<,"@$?=>|;#]+$/i'
You can also do the reverse, that is, test if your input fields have any invalid characters, using the regex provided by chaos:
$rex = '/[<,"@$?=>|;#]/';
This way, if the regex matches, then it means you have invalid characters.