タグ

ブックマーク / learnbyexample.github.io (1)

  • Search and replace tricks with ripgrep

    ripgrep (command name rg) is a grep tool, but supports search and replace as well. rg is far from a like-for-like alternate for sed, but it has nifty features like multiline replacement, fixed string matching, PCRE2 support, etc. This post gives an overview of syntax for substitution and highlights some of the cases where rg is a handy replacement for sed. Global search and replace🔗 $ cat ip.txt

    Search and replace tricks with ripgrep
    asiamoth
    asiamoth 2023/02/05
    愛用しているRust製Grepツール・ripgrepでファイル内容を置き換えるトリック。別ファイルに書き出すか、spongeを使う。Windows環境で雑に試してみると、sd(×sed)コマンドでも ほぼ同じ速度だった。
  • 1