| 161 |
Applications can use these to include support for different releases of PCRE. |
Applications can use these to include support for different releases of PCRE. |
| 162 |
</P> |
</P> |
| 163 |
<P> |
<P> |
| 164 |
|
In a Windows environment, if you want to statically link an application program |
| 165 |
|
against a non-dll <b>pcre.a</b> file, you must define PCRE_STATIC before |
| 166 |
|
including <b>pcre.h</b> or <b>pcrecpp.h</b>, because otherwise the |
| 167 |
|
<b>pcre_malloc()</b> and <b>pcre_free()</b> exported functions will be declared |
| 168 |
|
<b>__declspec(dllimport)</b>, with unwanted results. |
| 169 |
|
</P> |
| 170 |
|
<P> |
| 171 |
The functions <b>pcre_compile()</b>, <b>pcre_compile2()</b>, <b>pcre_study()</b>, |
The functions <b>pcre_compile()</b>, <b>pcre_compile2()</b>, <b>pcre_study()</b>, |
| 172 |
and <b>pcre_exec()</b> are used for compiling and matching regular expressions |
and <b>pcre_exec()</b> are used for compiling and matching regular expressions |
| 173 |
in a Perl-compatible manner. A sample program that demonstrates the simplest |
in a Perl-compatible manner. A sample program that demonstrates the simplest |
| 656 |
they acquire numbers in the usual way). There is no equivalent of this option |
they acquire numbers in the usual way). There is no equivalent of this option |
| 657 |
in Perl. |
in Perl. |
| 658 |
<pre> |
<pre> |
| 659 |
|
PCRE_UCP |
| 660 |
|
</pre> |
| 661 |
|
This option changes the way PCRE processes \b, \d, \s, \w, and some of the |
| 662 |
|
POSIX character classes. By default, only ASCII characters are recognized, but |
| 663 |
|
if PCRE_UCP is set, Unicode properties are used instead to classify characters. |
| 664 |
|
More details are given in the section on |
| 665 |
|
<a href="pcre.html#genericchartypes">generic character types</a> |
| 666 |
|
in the |
| 667 |
|
<a href="pcrepattern.html"><b>pcrepattern</b></a> |
| 668 |
|
page. If you set PCRE_UCP, matching one of the items it affects takes much |
| 669 |
|
longer. The option is available only if PCRE has been compiled with Unicode |
| 670 |
|
property support. |
| 671 |
|
<pre> |
| 672 |
PCRE_UNGREEDY |
PCRE_UNGREEDY |
| 673 |
</pre> |
</pre> |
| 674 |
This option inverts the "greediness" of the quantifiers so that they are not |
This option inverts the "greediness" of the quantifiers so that they are not |
| 777 |
64 ] is an invalid data character in JavaScript compatibility mode |
64 ] is an invalid data character in JavaScript compatibility mode |
| 778 |
65 different names for subpatterns of the same number are not allowed |
65 different names for subpatterns of the same number are not allowed |
| 779 |
66 (*MARK) must have an argument |
66 (*MARK) must have an argument |
| 780 |
|
67 this version of PCRE is not compiled with PCRE_UCP support |
| 781 |
</pre> |
</pre> |
| 782 |
The numbers 32 and 10000 in errors 48 and 49 are defaults; different values may |
The numbers 32 and 10000 in errors 48 and 49 are defaults; different values may |
| 783 |
be used if the limits were changed when PCRE was built. |
be used if the limits were changed when PCRE was built. |
| 850 |
PCRE handles caseless matching, and determines whether characters are letters, |
PCRE handles caseless matching, and determines whether characters are letters, |
| 851 |
digits, or whatever, by reference to a set of tables, indexed by character |
digits, or whatever, by reference to a set of tables, indexed by character |
| 852 |
value. When running in UTF-8 mode, this applies only to characters with codes |
value. When running in UTF-8 mode, this applies only to characters with codes |
| 853 |
less than 128. Higher-valued codes never match escapes such as \w or \d, but |
less than 128. By default, higher-valued codes never match escapes such as \w |
| 854 |
can be tested with \p if PCRE is built with Unicode character property |
or \d, but they can be tested with \p if PCRE is built with Unicode character |
| 855 |
support. The use of locales with Unicode is discouraged. If you are handling |
property support. Alternatively, the PCRE_UCP option can be set at compile |
| 856 |
characters with codes greater than 128, you should either use UTF-8 and |
time; this causes \w and friends to use Unicode property support instead of |
| 857 |
Unicode, or use locales, but not try to mix the two. |
built-in tables. The use of locales with Unicode is discouraged. If you are |
| 858 |
|
handling characters with codes greater than 128, you should either use UTF-8 |
| 859 |
|
and Unicode, or use locales, but not try to mix the two. |
| 860 |
</P> |
</P> |
| 861 |
<P> |
<P> |
| 862 |
PCRE contains an internal set of tables that are used when the final argument |
PCRE contains an internal set of tables that are used when the final argument |
| 1646 |
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 |
| 1647 |
call via <b>pcre_malloc()</b> fails, this error is given. The memory is |
call via <b>pcre_malloc()</b> fails, this error is given. The memory is |
| 1648 |
automatically freed at the end of matching. |
automatically freed at the end of matching. |
| 1649 |
|
</P> |
| 1650 |
|
<P> |
| 1651 |
|
This error is also given if <b>pcre_stack_malloc()</b> fails in |
| 1652 |
|
<b>pcre_exec()</b>. This can happen only when PCRE has been compiled with |
| 1653 |
|
<b>--disable-stack-for-recursion</b>. |
| 1654 |
<pre> |
<pre> |
| 1655 |
PCRE_ERROR_NOSUBSTRING (-7) |
PCRE_ERROR_NOSUBSTRING (-7) |
| 1656 |
</pre> |
</pre> |
| 2115 |
</P> |
</P> |
| 2116 |
<br><a name="SEC22" href="#TOC1">REVISION</a><br> |
<br><a name="SEC22" href="#TOC1">REVISION</a><br> |
| 2117 |
<P> |
<P> |
| 2118 |
Last updated: 03 May 2010 |
Last updated: 01 June 2010 |
| 2119 |
<br> |
<br> |
| 2120 |
Copyright © 1997-2010 University of Cambridge. |
Copyright © 1997-2010 University of Cambridge. |
| 2121 |
<br> |
<br> |