Limiting to a Specific Set of Characters in Regex Not Working
I need to validate a string to allow only a specific set of characters using regex. Unfortunately, I am stuck using regex only for the validation of these strings.
Anyways I need to limit a string to allow only the following characters: a-z and A-Z and 0-9 and space and .,;:!=+-_
For this I have created the following expression:
I can't figure out why this expression is not working. The following test strings when I am using this are giving me the following results:
<test> Valid $<test> Invalid test Valid <test>asdf</test> Invalid
It appears the order of these special characters is being taken into account when really all I need to to limit the validation to a specific list of valid characters regardless of the order in the string.
Can anyone shed some light on why this may be allowing special characters such as '<>' but only in certain orders?
use anchors and shild symbol -