Also see the excellent https://github.com/your-tools/ruplacer.
For more advanced needs, I have a custom thing called greprep that let's you make changes using your favorite editor. Workflow is like this:
1. $ rg -n .... > /tmp/lines.txt
2. (edit lines.txt in vscode)
3. $ greprep /tmp/lines.txt to apply the changes
replies(2):