How do I install pcre with homebrew?

2019-08-04 08:36发布

问题:

Background

I have a regex I want to run across multiple lines. My understanding is that OSX's grep can't handle this (please correct me if I'm wrong!). So after some Googling I found that PCRE would do what I want. I tried to install it with brew install pcre as a few sites suggested. It seems to have worked. If I run brew install pcre again I get this error Warning: pcre-8.40 already installed and I have a /usr/local/Cellar/pcre/8.40/ directory.

Problem

After installing PCRE via homebrew I get this error pcre: command not found when I try to use the pcre command.

Questions

Is there a second step I need to run after brew install pcre? I didn't find anything listed for this, but perhaps I missed it. I also found these instructions for installing PCRE manually. Is there a downside to doing this over homebrew?

回答1:

homebrew-core/pcre package is shipped with these binaries, so you probably need to try them:

  • pcre-config
  • pcregrep
  • pcretest


标签: homebrew pcre