/[pcre]/code/trunk/doc/pcreapi.3
ViewVC logotype

Diff of /code/trunk/doc/pcreapi.3

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 518 by ph10, Tue May 18 15:47:01 2010 UTC revision 542 by ph10, Tue Jun 15 08:49:47 2010 UTC
# Line 132  an application that uses PCRE. The heade Line 132  an application that uses PCRE. The heade
132  and PCRE_MINOR to contain the major and minor release numbers for the library.  and PCRE_MINOR to contain the major and minor release numbers for the library.
133  Applications can use these to include support for different releases of PCRE.  Applications can use these to include support for different releases of PCRE.
134  .P  .P
135    In a Windows environment, if you want to statically link an application program
136    against a non-dll \fBpcre.a\fP file, you must define PCRE_STATIC before
137    including \fBpcre.h\fP or \fBpcrecpp.h\fP, because otherwise the
138    \fBpcre_malloc()\fP and \fBpcre_free()\fP exported functions will be declared
139    \fB__declspec(dllimport)\fP, with unwanted results.
140    .P
141  The functions \fBpcre_compile()\fP, \fBpcre_compile2()\fP, \fBpcre_study()\fP,  The functions \fBpcre_compile()\fP, \fBpcre_compile2()\fP, \fBpcre_study()\fP,
142  and \fBpcre_exec()\fP are used for compiling and matching regular expressions  and \fBpcre_exec()\fP are used for compiling and matching regular expressions
143  in a Perl-compatible manner. A sample program that demonstrates the simplest  in a Perl-compatible manner. A sample program that demonstrates the simplest
# Line 1437  sample program. Line 1443  sample program.
1443    PCRE_NO_START_OPTIMIZE    PCRE_NO_START_OPTIMIZE
1444  .sp  .sp
1445  There are a number of optimizations that \fBpcre_exec()\fP uses at the start of  There are a number of optimizations that \fBpcre_exec()\fP uses at the start of
1446  a match, in order to speed up the process. For example, if it is known that a  a match, in order to speed up the process. For example, if it is known that an
1447  match must start with a specific character, it searches the subject for that  unanchored match must start with a specific character, it searches the subject
1448  character, and fails immediately if it cannot find it, without actually running  for that character, and fails immediately if it cannot find it, without
1449  the main matching function. When callouts are in use, these optimizations can  actually running the main matching function. This means that a special item
1450  cause them to be skipped. This option disables the "start-up" optimizations,  such as (*COMMIT) at the start of a pattern is not considered until after a
1451  causing performance to suffer, but ensuring that the callouts do occur.  suitable starting point for the match has been found. When callouts are in use,
1452    these "start-up" optimizations can cause them to be skipped if the pattern is
1453    never actually used. The PCRE_NO_START_OPTIMIZE option disables the start-up
1454    optimizations, causing performance to suffer, but ensuring that the callouts do
1455    occur, and that items such as (*COMMIT) are considered at every possible
1456    starting position in the subject string.
1457  .sp  .sp
1458    PCRE_NO_UTF8_CHECK    PCRE_NO_UTF8_CHECK
1459  .sp  .sp
# Line 1637  If a pattern contains back references, b Line 1648  If a pattern contains back references, b
1648  gets a block of memory at the start of matching to use for this purpose. If the  gets a block of memory at the start of matching to use for this purpose. If the
1649  call via \fBpcre_malloc()\fP fails, this error is given. The memory is  call via \fBpcre_malloc()\fP fails, this error is given. The memory is
1650  automatically freed at the end of matching.  automatically freed at the end of matching.
1651    .P
1652    This error is also given if \fBpcre_stack_malloc()\fP fails in
1653    \fBpcre_exec()\fP. This can happen only when PCRE has been compiled with
1654    \fB--disable-stack-for-recursion\fP.
1655  .sp  .sp
1656    PCRE_ERROR_NOSUBSTRING    (-7)    PCRE_ERROR_NOSUBSTRING    (-7)
1657  .sp  .sp
# Line 1985  Here is an example of a simple call to \ Line 2000  Here is an example of a simple call to \
2000  The unused bits of the \fIoptions\fP argument for \fBpcre_dfa_exec()\fP must be  The unused bits of the \fIoptions\fP argument for \fBpcre_dfa_exec()\fP must be
2001  zero. The only bits that may be set are PCRE_ANCHORED, PCRE_NEWLINE_\fIxxx\fP,  zero. The only bits that may be set are PCRE_ANCHORED, PCRE_NEWLINE_\fIxxx\fP,
2002  PCRE_NOTBOL, PCRE_NOTEOL, PCRE_NOTEMPTY, PCRE_NOTEMPTY_ATSTART,  PCRE_NOTBOL, PCRE_NOTEOL, PCRE_NOTEMPTY, PCRE_NOTEMPTY_ATSTART,
2003  PCRE_NO_UTF8_CHECK, PCRE_PARTIAL_HARD, PCRE_PARTIAL_SOFT, PCRE_DFA_SHORTEST,  PCRE_NO_UTF8_CHECK, PCRE_BSR_ANYCRLF, PCRE_BSR_UNICODE, PCRE_NO_START_OPTIMIZE,
2004  and PCRE_DFA_RESTART. All but the last four of these are exactly the same as  PCRE_PARTIAL_HARD, PCRE_PARTIAL_SOFT, PCRE_DFA_SHORTEST, and PCRE_DFA_RESTART.
2005  for \fBpcre_exec()\fP, so their description is not repeated here.  All but the last four of these are exactly the same as for \fBpcre_exec()\fP,
2006    so their description is not repeated here.
2007  .sp  .sp
2008    PCRE_PARTIAL_HARD    PCRE_PARTIAL_HARD
2009    PCRE_PARTIAL_SOFT    PCRE_PARTIAL_SOFT
# Line 2121  Cambridge CB2 3QH, England. Line 2137  Cambridge CB2 3QH, England.
2137  .rs  .rs
2138  .sp  .sp
2139  .nf  .nf
2140  Last updated: 16 May 2010  Last updated: 15 June 2010
2141  Copyright (c) 1997-2010 University of Cambridge.  Copyright (c) 1997-2010 University of Cambridge.
2142  .fi  .fi

Legend:
Removed from v.518  
changed lines
  Added in v.542

  ViewVC Help
Powered by ViewVC 1.1.5