I need to create a regular expression to match a string that contains anything other than the specified characters. The characters are
a-z A-Z 0-9
+ – * / : . $ %
and a space
I’m not very familiar with regex so I’m unsure how to put it together and test it. I can find lots of cheat sheets but I don’t know how to actually structure it as one whole pattern.
a
^in acapture groupcharacter class negates those characters in the class. So:Some characters there are special chars in regex so they’re escaped with
\.