mirror of
https://github.com/fish-shell/fish-shell
synced 2024-12-30 14:53:11 +00:00
864bb1f7a6
This disables an extra round of escaping in the `string replace -r` replacement string. Currently, to add a backslash to an a or b (to "escape" it): string replace -ra '([ab])' '\\\\\\\$1' a 7 backslashes! This removes one of the layers, so now 3 or 4 works (each one escaped for the single-quotes, so pcre receives two, which it reads as one literal): string replace -ra '([ab])' '\\\\$1' a This is backwards-incompatible as replacement strings will change meaning, so we put it behind a feature flag. The name is kinda crappy, though. Fixes #5474.
1 line
99 B
Text
1 line
99 B
Text
--features 'string-replace-fewer-backslashes' -C 'string replace -ra "\\\\" "\\\\\\\\" -- "a\b\c"'
|