Backslashes are used in basic regular expressions to denote special meaning. I think it would be much easier to read if the backslashed characters were ligatures.
Mockup using U+0952 or U+0332:

Ligatures to consider:
\(\)\+\*\{\}I agree reading backslashed chars is hard, and the problem is worth solving. I have some constraints though:
What I’m thinking right now is maybe making it thinner, and ignore if backslash is followed by another backslash immediately. From what I’ve seen backslashes are pretty much exclusively escape characters, with the exception of windows paths. I’ll give it some more thought, thanks!
From what I’ve seen backslashes are pretty much exclusively escape characters, with the exception of windows paths. I’ll give it some more thought, thanks!
This change doesn't look great for Coq/F*/etc, which use \/ (∨) for logical or and /\ for logical and (∧). (Iosevka has ligatures for these two). It doesn't work too well for Haskell either, which uses it for anonymous functions (\x -> x + 1) :: Num a => a -> a
I'm not sure how to fix these. Ignoring \ when preceded with a slash will break cases like sed 's/\(abc\)/xyz/g'; so would turning /\ into a ligature; for Haskell, it isn't clear that there's a valid ignore pattern, except for (\, and then that would look weird when used as an actual escape.
Not sure what the solution is.
Most helpful comment
I agree reading backslashed chars is hard, and the problem is worth solving. I have some constraints though:
What I’m thinking right now is maybe making it thinner, and ignore if backslash is followed by another backslash immediately. From what I’ve seen backslashes are pretty much exclusively escape characters, with the exception of windows paths. I’ll give it some more thought, thanks!