LoginSignup
0
0

More than 5 years have passed since last update.

git grepでperl互換の正規表現を使えるようにする

Posted at

perl互換の正規表現をつかってgit grepする場合は -P オプションをつけると出来るが、
これはgitのインストール時にUSE_LIBPCRE フラグをたててないと使えない

$ git grep -P ',,,\D'
fatal: cannot use Perl-compatible regexes when not compiled with USE_LIBPCRE

これまでmacだと brew install git --with-pcre とすればよかったらしいが
この方法はdeprecatedになったとのこと

Now in March 2018: Warning: git: --with-pcre was deprecated; using --with-pcre2 instead! So you'll have to brew reinstall --with-pcre2 git

2018年だと下記のオプションでいれることになる

$ brew reinstall --with-pcre2 git

参考

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0