We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
I want to replace \w+ with $a.
\w+
$a
Nothing seems to work using latest git version (4ccc522):
$ echo foo | sd '\w+' '$a' $ echo foo | sd '\w+' '\$a' \ $ echo foo | sd '\w+' '\\$a' \ $ echo foo | sd '\w+' '\\\$a' \ $ echo foo | sd '\w+' '\\\\$a' \ $ echo foo | sd '\w+' '\\\\\$a' \\\
Using string mode works, but then I can't use regex in the search:
$ echo foo | sd -s 'foo' '$a' $a
The text was updated successfully, but these errors were encountered:
$ echo foo | sd '\w+' '$$a' $a
w+
w
$$
$
Sorry, something went wrong.
Use $$ to indicate literal $ character in replacement section.
Ah, could this be documented in --help?
--help
Just checked the help page and seems it isn't documented. I knew about $$ from using ripgrep. Perhaps you could submit the PR.
ripgrep
sd and ripgrep both use rust's regex implementation, so anything there is supported here:
https://docs.rs/regex/latest/regex/
Created a PR to document it in the readme.
CosmicHorrorDev
Successfully merging a pull request may close this issue.
I want to replace
\w+
with$a
.Nothing seems to work using latest git version (4ccc522):
Using string mode works, but then I can't use regex in the search:
The text was updated successfully, but these errors were encountered: