Use a simple lookup table—a hash—you initialize yourself.
By the way, \s is not a character escape sequence; it's a regular expression pattern escape sequence. There's no general, one-to-one pairing of characters with regex patterns.
In reply to Re: Printing escaped values of control characters
by Jim
in thread Printing escaped values of control characters
by miketosh
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |