pcre2
1.1、pcre2简介
short for:Perl Compatible Regular Expressions Version 2
是什么 ?:library and utilities that implement regular expression pattern matching using the same syntax and semantics as Perl 5.
开发语言:C
官方主页:http://www.pcre.org
1.2、通过包管理器安装pcre2
操作系统包管理器安装命令
Windowsscoopscoop install pcregrep
macOSHomeBrewbrew install pcre2
GNU/LinuxLinuxBrewbrew install pcre2
aptsudo apt-get install -y pcre2-utils libpcre2-dev
CentOSyumsudo yum install -y pcre2-tools pcre2-devel
dnfsudo dnf install -y pcre2-tools pcre2-devel
openSUSEzyppersudo zypper install -y pcre2-tools pcre2-devel
Alpine Linuxapksudo apk add pcre2-tools pcre2-dev

Arch Linux

ArcoLinux

Manjaro Linux

pacmansudo pacman -Syyu --noconfirm
sudo pacman -S    --noconfirm pcre2
Gentoo LinuxPortagesudo emerge libpcre2
1.3、通过编译源码安装pcre2 

step1、安装依赖

下载时cURL
解压时targzip
编译时POSIX shGNU CoreUtilsGNU makeGCC ( gcc )   | LLVM / Clang
运行时glibc ( libc.solibpthread.sold-linux-x86-64.so )

step2、使用curl命令下载pcre2源码包 (

curl -LO https://ftp.pcre.org/pub/pcre/pcre2-10.34.tar.gz

step3、使用tar解压pcre2源码包

tar vxf pcre2-10.34.tar.gz

step4、进入pcre2-10.34目录,并查看它的内容

step5、配置、编译、安装

./configure && make && sudo make install
1.4、pcre2中包含的命令
1.5、pcre2中包含的头文件
1.6、pcre2中包含的库文件
  • libpcre2-posix.so
  • libpcre2-32.so
  • libpcre2-16.so
  • libpcre2-8.so