- Outside of a character class, you do not need to escape - or ]
- Inside a character class, you always need to escape these 3 characters: -]\, if intended literally. And you need to escape this character: ^, if intended literally, but only if it is at the start of the character class.
- Something to check is when you use one of these 2 characters: -\, at the end of a character class.