$rex = '/^[^<,"@?=>|;#]$/i';
I'm having trouble with this regular expression. The idea is that the input fields are checked for certain characters and if present, throw an error.
This regex is throwing errors for every string longer than 1 character. Can anyone tell me what I'm doing wrong?
EDIT: People are saying they don't see what I want to do with this regex. What I want to do is refuse the input if one of the following characters is part of the entered string:
< > , " @ ? = | ; #
EDIT2: JG's "valid" regex does the trick.