I've searched far and wide on regular expressions and can find just about every example of what I would need, except one.
I'm trying to prevent users from entering the following characters:
" < > $ *
but I want users to be able to enter backslashes ().
I'm trying this:
ereg("^[^\"<>\$\*]*$", $input);
which, of course, works for the characeters I don't want to allow, but for reasons I can't discern, the expression also returns false whenever I add a backslash to the input string, even though I haven't specifically (to my knowledge) added a backslash anywhere in the expression (all backslashes are only used to escape special regex characters in the expression).
Why is this returning false when I add a backslash to the input string?
Thanks!