Replace using numbered group references

ned

  • Is like `grep` but with powerful replace capabilities.
    Unlike `sed`, as it isn't restricted to line oriented editing.
    More information: <https://github.com/nevdelap/ned>.
  • Trick copyright: tl;dr; <https://github.com/tldr-pages/tldr>

ned '{{the ([a-z]+) dog and the ([a-z]+) dog}}' --replace '{{the $2 dog and the $1 dog}}' {{.}}

click the source code to copy