What literal characters should be escaped in a regex?
In many regex implementations, the following rules apply: Meta characters inside a character class are: ^ (negation) – (range) ] (end of the class) \ (escape char) So these should all be escaped. There are some corner cases though: – needs no escaping if placed at the very start, or end of the class ([abc-] … Read more