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
ripgrep 13.0.0
Debian
Ubuntu 22.04
Can't use $1 in replacements when followed by underscore
$1
echo "hello" | rg '(.*)' -r '--$1_--'
DEBUG|rg::config|crates/core/config.rs:40: /home/bruno/.ripgreprc: arguments loaded from config file: ["--no-line-number"] DEBUG|rg::args|crates/core/args.rs:543: final argv: ["rg", "--no-line-number", "(.*)", "-r", "--$1_--", "--debug"] DEBUG|globset|/usr/share/cargo/registry/ripgrep-13.0.0/debian/cargo_registry/globset-0.4.8/src/lib.rs:421: built glob set; 0 literals, 0 basenames, 12 extensions, 0 prefixes, 0 suffixes, 0 required extensions, 0 regexes ----
Output should be: --hello_--
--hello_--
The text was updated successfully, but these errors were encountered:
Duplicate of #2201.
Use ${1} instead. Otherwise the _ is treated as part of the capture group reference.
${1}
_
Sorry, something went wrong.
Sorry for the duplicate !
No branches or pull requests
What version of ripgrep are you using?
ripgrep 13.0.0
How did you install ripgrep?
Debian
What operating system are you using ripgrep on?
Ubuntu 22.04
Describe your bug.
Can't use
$1
in replacements when followed by underscoreWhat are the steps to reproduce the behavior?
echo "hello" | rg '(.*)' -r '--$1_--'
What is the actual behavior?
What is the expected behavior?
Output should be:
--hello_--
The text was updated successfully, but these errors were encountered: