I’m trying to match a character constant. I only want single characters and a few escape sequences rather than \ followed by any letter.
This is very similar to this question with the added requirement of specific escape characters.
Regular expression to match escaped characters (quotes)
'(\\\[tvrnafb\\\]|.)'
I feel dumb, I just had to remove the period in the other answer and add another character class.