I acknowledge this question may be unanswerable, or extremely difficult to answer.
Also, notwithstanding I expect this audience to be familiar with what escape sequences in e.g. scripting languages are, for reasons of clarity you'll see later in the post, I'll review that concept:
By "escaped," I mean for example printable characters which are interpreted as "Do not use the next character as usual; interpret it in another context." Contexts for this include characters intended not to be interpreted as code, but as literal printed characters, or conversely, characters which may usually be interpreted as literal characters which we want to interpret instead as code. My examples (more confusingly, I now realize) use the latter case.
Specific example: a regex used with 'nix sed, which, when not escaped for sed, is this:
([^0-9]*)(20[0-9]{2})([^0-9]{1,2})([0-9]{1,2})
But when escaped for the shell to pass the regex to sed such that sed knows to interpret the characters not as literal characters, but as regex code, the whole string becomes much uglier (and much less human-readable):
\([^0-9]*\)\(20[0-9]\{2\}\)\([^0-9]\{1,2\}\)\([0-9]\{1,2}\)
Escape characters (or sequences) are one of the banes of programming. This is especially true for long strings (or code lines), where it is only practical to either pay extreme attention and/or use tools that create and remove escape sequences.
I've looked around and not encountered a solution like what I'll propose, but not knowing what this may be named if it exists, and not being an expert, the search was futile.
Where I say things like "control code page assignment," I'm talking about code pages in the sense of tables of printable (and non-printable) characters that computers use to render and control the layout of text, etc., as explained in the wikipedia article on "Code Pages". You could (loosely) call these "computer alphabets," if you will. Where I say "code page assignment," I mean an entry in the computer's "alphabet" interpreted either as a rendered glyph (printable character) or unprinted control code (non-printable characters).
The idea is to designate a specific, unprinted control code page assignment to mean "interpret the next character as escaped," which the text renderer could "read" and indicate to the programmer by changing e.g. the color and/or brightness of the escaped character that follows the control code. And/or the control code page assignment could be a printable glyph, being for example a standardized, non-intrusive accent glyph which doesn't conflict with any other accents in any alphabets related to the Roman alphabet.
This unprinted code page assignment would also be read by interpreters and compilers similarly.
Suppose a rendered version of a longer regex than what I gave above:
If we had an unprinted code page assignment that means "the next character is escaped," the escaped characters could for example simply be rendered brighter, to indicate they are escaped:
That is far eisier for a human to interpret (albiet this is difficult to begin with as a regex) than the following, which instead uses printed characters for escape sequences:
The predominant if not universal situation as I write this is to use printed characters in escape sequences, not unprinted code page assignments.
Attendant problems to the proposed solution would be ensuring conformity to the escaped code page assignment by so many tools which programmers use. Programmers would also have to know which utilities support the escaped code page assignment and which don't. Also, it would be best for any tools adopting such a code page assignment to be explicit about whether they are backward compatible (whether they can use both printed characters and an unprinted code page assignment for escape sequences).
I would not prefer any programming language or tool that accomplished this by any means other than an escape control code page assignment. All the same, I'd be very curious about any tools that do this.
So after all of that, my question is: what programming languages exist that do this, and/or is there already a code page assignment that does this?