readme

来自「Ubuntu packages of security software。 相」· 代码 · 共 729 行 · 第 1/3 页

TXT
729
字号
README file for PCRE (Perl-compatible regular expression library)-----------------------------------------------------------------The latest release of PCRE is always available from  ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/pcre-xxx.tar.gzThere is a mailing list for discussion about the development of PCRE at  pcre-dev@exim.orgPlease read the NEWS file if you are upgrading from a previous release.The contents of this README file are:  The PCRE APIs  Documentation for PCRE  Contributions by users of PCRE  Building PCRE on non-Unix systems  Building PCRE on Unix-like systems  Retrieving configuration information on Unix-like systems  Shared libraries on Unix-like systems  Cross-compiling on Unix-like systems  Using HP's ANSI C++ compiler (aCC)  Making new tarballs  Testing PCRE  Character tables  File manifestThe PCRE APIs-------------PCRE is written in C, and it has its own API. The distribution also includes aset of C++ wrapper functions (see the pcrecpp man page for details), courtesyof Google Inc.In addition, there is a set of C wrapper functions that are based on the POSIXregular expression API (see the pcreposix man page). These end up in thelibrary called libpcreposix. Note that this just provides a POSIX callinginterface to PCRE; the regular expressions themselves still follow Perl syntaxand semantics. The POSIX API is restricted, and does not give full access toall of PCRE's facilities.The header file for the POSIX-style functions is called pcreposix.h. Theofficial POSIX name is regex.h, but I did not want to risk possible problemswith existing files of that name by distributing it that way. To use PCRE withan existing program that uses the POSIX API, pcreposix.h will have to berenamed or pointed at by a link.If you are using the POSIX interface to PCRE and there is already a POSIX regexlibrary installed on your system, as well as worrying about the regex.h headerfile (as mentioned above), you must also take care when linking programs toensure that they link with PCRE's libpcreposix library. Otherwise they may pickup the POSIX functions of the same name from the other library.One way of avoiding this confusion is to compile PCRE with the addition of-Dregcomp=PCREregcomp (and similarly for the other POSIX functions) to thecompiler flags (CFLAGS if you are using "configure" -- see below). This has theeffect of renaming the functions so that the names no longer clash. Of course,you have to do the same thing for your applications, or write them using thenew names.Documentation for PCRE----------------------If you install PCRE in the normal way on a Unix-like system, you will end upwith a set of man pages whose names all start with "pcre". The one that is justcalled "pcre" lists all the others. In addition to these man pages, the PCREdocumentation is supplied in two other forms:  1. There are files called doc/pcre.txt, doc/pcregrep.txt, and     doc/pcretest.txt in the source distribution. The first of these is a     concatenation of the text forms of all the section 3 man pages except     those that summarize individual functions. The other two are the text     forms of the section 1 man pages for the pcregrep and pcretest commands.     These text forms are provided for ease of scanning with text editors or     similar tools. They are installed in <prefix>/share/doc/pcre, where     <prefix> is the installation prefix (defaulting to /usr/local).  2. A set of files containing all the documentation in HTML form, hyperlinked     in various ways, and rooted in a file called index.html, is distributed in     doc/html and installed in <prefix>/share/doc/pcre/html.Contributions by users of PCRE------------------------------You can find contributions from PCRE users in the directory  ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/ContribThere is a README file giving brief descriptions of what they are. Some arecomplete in themselves; others are pointers to URLs containing relevant files.Some of this material is likely to be well out-of-date. Several of the earliercontributions provided support for compiling PCRE on various flavours ofWindows (I myself do not use Windows). Nowadays there is more Windows supportin the standard distribution, so these contibutions have been archived.Building PCRE on non-Unix systems---------------------------------For a non-Unix system, please read the comments in the file NON-UNIX-USE,though if your system supports the use of "configure" and "make" you may beable to build PCRE in the same way as for Unix-like systems. PCRE can also beconfigured in many platform environments using the GUI facility of CMake'sCMakeSetup. It creates Makefiles, solution files, etc.PCRE has been compiled on many different operating systems. It should bestraightforward to build PCRE on any system that has a Standard C compiler andlibrary, because it uses only Standard C functions.Building PCRE on Unix-like systems----------------------------------If you are using HP's ANSI C++ compiler (aCC), please see the special notein the section entitled "Using HP's ANSI C++ compiler (aCC)" below.The following instructions assume the use of the widely used "configure, make,make install" process. There is also some experimental support for "cmake" inthe PCRE distribution, but it is incomplete and not documented. However, if youare a "cmake" user, you might want to try it.To build PCRE on a Unix-like system, first run the "configure" command from thePCRE distribution directory, with your current directory set to the directorywhere you want the files to be created. This command is a standard GNU"autoconf" configuration script, for which generic instructions are supplied inthe file INSTALL.Most commonly, people build PCRE within its own distribution directory, and inthis case, on many systems, just running "./configure" is sufficient. However,the usual methods of changing standard defaults are available. For example:CFLAGS='-O2 -Wall' ./configure --prefix=/opt/localspecifies that the C compiler should be run with the flags '-O2 -Wall' insteadof the default, and that "make install" should install PCRE under /opt/localinstead of the default /usr/local.If you want to build in a different directory, just run "configure" with thatdirectory as current. For example, suppose you have unpacked the PCRE sourceinto /source/pcre/pcre-xxx, but you want to build it in /build/pcre/pcre-xxx:cd /build/pcre/pcre-xxx/source/pcre/pcre-xxx/configurePCRE is written in C and is normally compiled as a C library. However, it ispossible to build it as a C++ library, though the provided building apparatusdoes not have any features to support this.There are some optional features that can be included or omitted from the PCRElibrary. You can read more about them in the pcrebuild man page.. If you want to suppress the building of the C++ wrapper library, you can add  --disable-cpp to the "configure" command. Otherwise, when "configure" is run,  it will try to find a C++ compiler and C++ header files, and if it succeeds,  it will try to build the C++ wrapper.. If you want to make use of the support for UTF-8 character strings in PCRE,  you must add --enable-utf8 to the "configure" command. Without it, the code  for handling UTF-8 is not included in the library. (Even when included, it  still has to be enabled by an option at run time.). If, in addition to support for UTF-8 character strings, you want to include  support for the \P, \p, and \X sequences that recognize Unicode character  properties, you must add --enable-unicode-properties to the "configure"  command. This adds about 30K to the size of the library (in the form of a  property table); only the basic two-letter properties such as Lu are  supported.. You can build PCRE to recognize either CR or LF or the sequence CRLF or any  of the preceding, or any of the Unicode newline sequences as indicating the  end of a line. Whatever you specify at build time is the default; the caller  of PCRE can change the selection at run time. The default newline indicator  is a single LF character (the Unix standard). You can specify the default  newline indicator by adding --enable-newline-is-cr or --enable-newline-is-lf  or --enable-newline-is-crlf or --enable-newline-is-anycrlf or  --enable-newline-is-any to the "configure" command, respectively.  If you specify --enable-newline-is-cr or --enable-newline-is-crlf, some of  the standard tests will fail, because the lines in the test files end with  LF. Even if the files are edited to change the line endings, there are likely  to be some failures. With --enable-newline-is-anycrlf or  --enable-newline-is-any, many tests should succeed, but there may be some  failures.. By default, the sequence \R in a pattern matches any Unicode line ending  sequence. This is independent of the option specifying what PCRE considers to  be the end of a line (see above). However, the caller of PCRE can restrict \R  to match only CR, LF, or CRLF. You can make this the default by adding  --enable-bsr-anycrlf to the "configure" command (bsr = "backslash R").. When called via the POSIX interface, PCRE uses malloc() to get additional  storage for processing capturing parentheses if there are more than 10 of  them in a pattern. You can increase this threshold by setting, for example,  --with-posix-malloc-threshold=20  on the "configure" command.. PCRE has a counter that can be set to limit the amount of resources it uses.  If the limit is exceeded during a match, the match fails. The default is ten  million. You can change the default by setting, for example,  --with-match-limit=500000  on the "configure" command. This is just the default; individual calls to  pcre_exec() can supply their own value. There is more discussion on the  pcreapi man page.. There is a separate counter that limits the depth of recursive function calls  during a matching process. This also has a default of ten million, which is  essentially "unlimited". You can change the default by setting, for example,  --with-match-limit-recursion=500000  Recursive function calls use up the runtime stack; running out of stack can  cause programs to crash in strange ways. There is a discussion about stack  sizes in the pcrestack man page.. The default maximum compiled pattern size is around 64K. You can increase  this by adding --with-link-size=3 to the "configure" command. You can  increase it even more by setting --with-link-size=4, but this is unlikely  ever to be necessary. Increasing the internal link size will reduce  performance.. You can build PCRE so that its internal match() function that is called from  pcre_exec() does not call itself recursively. Instead, it uses memory blocks  obtained from the heap via the special functions pcre_stack_malloc() and  pcre_stack_free() to save data that would otherwise be saved on the stack. To  build PCRE like this, use  --disable-stack-for-recursion  on the "configure" command. PCRE runs more slowly in this mode, but it may be  necessary in environments with limited stack sizes. This applies only to the  pcre_exec() function; it does not apply to pcre_dfa_exec(), which does not  use deeply nested recursion. There is a discussion about stack sizes in the  pcrestack man page.. For speed, PCRE uses four tables for manipulating and identifying characters

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?