sd icon indicating copy to clipboard operation
sd copied to clipboard

Use something other than `$` for capture group prefix

Open nc7s opened this issue 2 years ago • 2 comments

$ is good in programming languages, but interacts badly with shells. Disambiguation of numbered capture groups goes even further, as ${} is also a shell construct.

% might be a good choice.

nc7s avatar Dec 25 '23 12:12 nc7s

What’s wrong with backslashes, like ‘sed’?

butter-radish avatar Sep 26 '25 02:09 butter-radish

What’s wrong with backslashes, like ‘sed’?

It's the start of escape sequences, and I can never remember what exactly are escaped and how, so tend to avoid it.

nc7s avatar Sep 26 '25 11:09 nc7s