What is a regular expression for control characters?
I'm trying to match a control character in the form \^c where c is any valid character for control characters. I have this regular expression, but it's not currently working: \\[^][@-z] I think the problem lies with the fact that the caret character (^) is part of the regular expressions parsing engine. Match an ASCII text string of the form ^X using the pattern \^. , nothing more. Match an ASCII text string of the form \^X with the pattern \\\^. . You may wish to constrain that dot to [?@_\[\]^\\] , so \\\^[A-Z?@_\[\]^\\] . It’s easier to read as [?\x40-\x5F] for the bracketed character class