在Ubuntu或者Debian中安装PCRE库( Perl 5 Compatible Regular Expression Library )

原文地址:

Ubuntu / Debian Install PCRE Library ( Perl 5 Compatible Regular Expression Library )

http://www.cyberciti.biz/faq/debian-ubuntu-linux-install-libpcre3-dev/

I need to compile few application and I need Perl 5 Compatible Regular Expression Library (PCRE). Under CentOS I can use a package called pcre-devel, but Debian do not have the same. How do I install pcre-devel under Debian / Ubuntu Linux?

我需要编译一些应用程序,同时也需要Perl 5 兼容正则表达式库(PCRE)。在CentOs下,我可以使用一个叫pcre-devel,但是Debian可就不一样了。我怎样在Debian/Ubuntu  Linux下安装pcre-devel呢?

Perl-compatible regular expression library. PCRE has its own native API, but a set of “wrapper” functions that are based on the POSIX API are also supplied in the library libpcreposix. Note that this just provides a POSIX calling interface to PCRE: the regular expressions themselves still follow Perl syntax and semantics. The header file for the POSIX-style functions is called pcreposix.h. To install PCRE, type thy following command:

Perl兼容正则表达式库(PCRE)有自己原生API,但是这一系列封装函是基于POSIX API,而POSIX API也支持libpcreposix库。这样只要提供一个POSIX的调用接口给PCRE后,正则表达式本身仍遵循Perl的语法和语义。POSIX-style的头文件是pcreposix.h,所以,安装PCRE,需要运行以下命令。

?
1
2
sudo apt-get update
sudo apt-get install libpcre3 libpcre3-dev

你可能还需要安装
sudo apt-get install openssl libssl-dev

The PCRE library is a set of functions that implement regular expression pattern matching using the same syntax and semantics as Perl, with just a few differences. Certain features that appeared in Python and PCRE before they appeared in Perl are also available using the Python syntax. There is also some support for certain .NET and Oniguruma syntax items, and there is an option for requesting some minor changes that give better JavaScript compatibility. The current implementation of PCRE (release 7.x) corresponds approximately with Perl 5.10, including support for UTF-8 encoded strings and Unicode general category properties. However, UTF-8 and Unicode support has to be explicitly enabled; it is not the default. The Unicode tables correspond to Unicode release 5.0.0. In addition to the Perl-compatible matching function, PCRE contains an alternative matching function that matches the same compiled patterns in a different way. In certain circumstances, the alternative function has some advantages. For a discussion of the two matching algorithms, see the pcrematching page. PCRE is written in C and released as a C library. A number of people have written wrappers and interfaces of various kinds. In particular, Google Inc. have provided a comprehensive C++ wrapper. This is now included as part of the PCRE distribution. The pcrecpp page has details of this interface. Other people's contributions can be found in the Contrib directory at the primary FTP site, which is: ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre Details of exactly which Perl regular expression features are and are not supported by PCRE are given in separate documents. See the pcrepattern and pcrecompat pages. There is a syntax summary in the pcresyntax page. Some features of PCRE can be included, excluded, or changed when the library is built. The pcre_config() function makes it possible for a client to discover which features are available. The features themselves are described in the pcrebuild page. Documentation about building PCRE for various operating systems can be found in the README file in the source distribution. The library contains a number of undocumented internal functions and data tables that are used by more than one of the exported external functions, but which are not intended for use by external callers. Their names all begin with "_pcre_", which hopefully will not provoke any name clashes. In some environments, it is possible to control which external symbols are exported when a shared library is built, and in these cases the undocumented symbols are not exported.
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值