Remove obsolete pcre code
[privoxy.git] / pcre / doc / pcre.html
diff --git a/pcre/doc/pcre.html b/pcre/doc/pcre.html
deleted file mode 100644 (file)
index b12b212..0000000
+++ /dev/null
@@ -1,2397 +0,0 @@
-<HTML>\r
-<HEAD>\r
-<TITLE>pcre specification</TITLE>\r
-</HEAD>\r
-<body bgcolor="#FFFFFF" text="#00005A">\r
-<H1>pcre specification</H1>\r
-This HTML document has been generated automatically from the original man page.\r
-If there is any nonsense in it, please consult the man page in case the\r
-conversion went wrong.\r
-<UL>\r
-<LI><A NAME="TOC1" HREF="#SEC1">NAME</A>\r
-<LI><A NAME="TOC2" HREF="#SEC2">SYNOPSIS</A>\r
-<LI><A NAME="TOC3" HREF="#SEC3">DESCRIPTION</A>\r
-<LI><A NAME="TOC4" HREF="#SEC4">MULTI-THREADING</A>\r
-<LI><A NAME="TOC5" HREF="#SEC5">COMPILING A PATTERN</A>\r
-<LI><A NAME="TOC6" HREF="#SEC6">STUDYING A PATTERN</A>\r
-<LI><A NAME="TOC7" HREF="#SEC7">LOCALE SUPPORT</A>\r
-<LI><A NAME="TOC8" HREF="#SEC8">INFORMATION ABOUT A PATTERN</A>\r
-<LI><A NAME="TOC9" HREF="#SEC9">MATCHING A PATTERN</A>\r
-<LI><A NAME="TOC10" HREF="#SEC10">EXTRACTING CAPTURED SUBSTRINGS</A>\r
-<LI><A NAME="TOC11" HREF="#SEC11">LIMITATIONS</A>\r
-<LI><A NAME="TOC12" HREF="#SEC12">DIFFERENCES FROM PERL</A>\r
-<LI><A NAME="TOC13" HREF="#SEC13">REGULAR EXPRESSION DETAILS</A>\r
-<LI><A NAME="TOC14" HREF="#SEC14">BACKSLASH</A>\r
-<LI><A NAME="TOC15" HREF="#SEC15">CIRCUMFLEX AND DOLLAR</A>\r
-<LI><A NAME="TOC16" HREF="#SEC16">FULL STOP (PERIOD, DOT)</A>\r
-<LI><A NAME="TOC17" HREF="#SEC17">SQUARE BRACKETS</A>\r
-<LI><A NAME="TOC18" HREF="#SEC18">POSIX CHARACTER CLASSES</A>\r
-<LI><A NAME="TOC19" HREF="#SEC19">VERTICAL BAR</A>\r
-<LI><A NAME="TOC20" HREF="#SEC20">INTERNAL OPTION SETTING</A>\r
-<LI><A NAME="TOC21" HREF="#SEC21">SUBPATTERNS</A>\r
-<LI><A NAME="TOC22" HREF="#SEC22">REPETITION</A>\r
-<LI><A NAME="TOC23" HREF="#SEC23">BACK REFERENCES</A>\r
-<LI><A NAME="TOC24" HREF="#SEC24">ASSERTIONS</A>\r
-<LI><A NAME="TOC25" HREF="#SEC25">ONCE-ONLY SUBPATTERNS</A>\r
-<LI><A NAME="TOC26" HREF="#SEC26">CONDITIONAL SUBPATTERNS</A>\r
-<LI><A NAME="TOC27" HREF="#SEC27">COMMENTS</A>\r
-<LI><A NAME="TOC28" HREF="#SEC28">RECURSIVE PATTERNS</A>\r
-<LI><A NAME="TOC29" HREF="#SEC29">PERFORMANCE</A>\r
-<LI><A NAME="TOC30" HREF="#SEC30">UTF-8 SUPPORT</A>\r
-<LI><A NAME="TOC31" HREF="#SEC31">AUTHOR</A>\r
-</UL>\r
-<LI><A NAME="SEC1" HREF="#TOC1">NAME</A>\r
-<P>\r
-pcre - Perl-compatible regular expressions.\r
-</P>\r
-<LI><A NAME="SEC2" HREF="#TOC1">SYNOPSIS</A>\r
-<P>\r
-<B>#include &#60;pcre.h&#62;</B>\r
-</P>\r
-<P>\r
-<B>pcre *pcre_compile(const char *<I>pattern</I>, int <I>options</I>,</B>\r
-<B>const char **<I>errptr</I>, int *<I>erroffset</I>,</B>\r
-<B>const unsigned char *<I>tableptr</I>);</B>\r
-</P>\r
-<P>\r
-<B>pcre_extra *pcre_study(const pcre *<I>code</I>, int <I>options</I>,</B>\r
-<B>const char **<I>errptr</I>);</B>\r
-</P>\r
-<P>\r
-<B>int pcre_exec(const pcre *<I>code</I>, const pcre_extra *<I>extra</I>,</B>\r
-<B>const char *<I>subject</I>, int <I>length</I>, int <I>startoffset</I>,</B>\r
-<B>int <I>options</I>, int *<I>ovector</I>, int <I>ovecsize</I>);</B>\r
-</P>\r
-<P>\r
-<B>int pcre_copy_substring(const char *<I>subject</I>, int *<I>ovector</I>,</B>\r
-<B>int <I>stringcount</I>, int <I>stringnumber</I>, char *<I>buffer</I>,</B>\r
-<B>int <I>buffersize</I>);</B>\r
-</P>\r
-<P>\r
-<B>int pcre_get_substring(const char *<I>subject</I>, int *<I>ovector</I>,</B>\r
-<B>int <I>stringcount</I>, int <I>stringnumber</I>,</B>\r
-<B>const char **<I>stringptr</I>);</B>\r
-</P>\r
-<P>\r
-<B>int pcre_get_substring_list(const char *<I>subject</I>,</B>\r
-<B>int *<I>ovector</I>, int <I>stringcount</I>, const char ***<I>listptr</I>);</B>\r
-</P>\r
-<P>\r
-<B>void pcre_free_substring(const char *<I>stringptr</I>);</B>\r
-</P>\r
-<P>\r
-<B>void pcre_free_substring_list(const char **<I>stringptr</I>);</B>\r
-</P>\r
-<P>\r
-<B>const unsigned char *pcre_maketables(void);</B>\r
-</P>\r
-<P>\r
-<B>int pcre_fullinfo(const pcre *<I>code</I>, const pcre_extra *<I>extra</I>,</B>\r
-<B>int <I>what</I>, void *<I>where</I>);</B>\r
-</P>\r
-<P>\r
-<B>int pcre_info(const pcre *<I>code</I>, int *<I>optptr</I>, int</B>\r
-<B>*<I>firstcharptr</I>);</B>\r
-</P>\r
-<P>\r
-<B>char *pcre_version(void);</B>\r
-</P>\r
-<P>\r
-<B>void *(*pcre_malloc)(size_t);</B>\r
-</P>\r
-<P>\r
-<B>void (*pcre_free)(void *);</B>\r
-</P>\r
-<LI><A NAME="SEC3" HREF="#TOC1">DESCRIPTION</A>\r
-<P>\r
-The PCRE library is a set of functions that implement regular expression\r
-pattern matching using the same syntax and semantics as Perl 5, with just a few\r
-differences (see below). The current implementation corresponds to Perl 5.005,\r
-with some additional features from later versions. This includes some\r
-experimental, incomplete support for UTF-8 encoded strings. Details of exactly\r
-what is and what is not supported are given below.\r
-</P>\r
-<P>\r
-PCRE has its own native API, which is described in this document. There is also\r
-a set of wrapper functions that correspond to the POSIX regular expression API.\r
-These are described in the <B>pcreposix</B> documentation.\r
-</P>\r
-<P>\r
-The native API function prototypes are defined in the header file <B>pcre.h</B>,\r
-and on Unix systems the library itself is called <B>libpcre.a</B>, so can be\r
-accessed by adding <B>-lpcre</B> to the command for linking an application which\r
-calls it. The header file defines the macros PCRE_MAJOR and PCRE_MINOR to\r
-contain the major and minor release numbers for the library. Applications can\r
-use these to include support for different releases.\r
-</P>\r
-<P>\r
-The functions <B>pcre_compile()</B>, <B>pcre_study()</B>, and <B>pcre_exec()</B>\r
-are used for compiling and matching regular expressions.\r
-</P>\r
-<P>\r
-The functions <B>pcre_copy_substring()</B>, <B>pcre_get_substring()</B>, and\r
-<B>pcre_get_substring_list()</B> are convenience functions for extracting\r
-captured substrings from a matched subject string; <B>pcre_free_substring()</B>\r
-and <B>pcre_free_substring_list()</B> are also provided, to free the memory used\r
-for extracted strings.\r
-</P>\r
-<P>\r
-The function <B>pcre_maketables()</B> is used (optionally) to build a set of\r
-character tables in the current locale for passing to <B>pcre_compile()</B>.\r
-</P>\r
-<P>\r
-The function <B>pcre_fullinfo()</B> is used to find out information about a\r
-compiled pattern; <B>pcre_info()</B> is an obsolete version which returns only\r
-some of the available information, but is retained for backwards compatibility.\r
-The function <B>pcre_version()</B> returns a pointer to a string containing the\r
-version of PCRE and its date of release.\r
-</P>\r
-<P>\r
-The global variables <B>pcre_malloc</B> and <B>pcre_free</B> initially contain\r
-the entry points of the standard <B>malloc()</B> and <B>free()</B> functions\r
-respectively. PCRE calls the memory management functions via these variables,\r
-so a calling program can replace them if it wishes to intercept the calls. This\r
-should be done before calling any PCRE functions.\r
-</P>\r
-<LI><A NAME="SEC4" HREF="#TOC1">MULTI-THREADING</A>\r
-<P>\r
-The PCRE functions can be used in multi-threading applications, with the\r
-proviso that the memory management functions pointed to by <B>pcre_malloc</B>\r
-and <B>pcre_free</B> are shared by all threads.\r
-</P>\r
-<P>\r
-The compiled form of a regular expression is not altered during matching, so\r
-the same compiled pattern can safely be used by several threads at once.\r
-</P>\r
-<LI><A NAME="SEC5" HREF="#TOC1">COMPILING A PATTERN</A>\r
-<P>\r
-The function <B>pcre_compile()</B> is called to compile a pattern into an\r
-internal form. The pattern is a C string terminated by a binary zero, and\r
-is passed in the argument <I>pattern</I>. A pointer to a single block of memory\r
-that is obtained via <B>pcre_malloc</B> is returned. This contains the\r
-compiled code and related data. The <B>pcre</B> type is defined for this for\r
-convenience, but in fact <B>pcre</B> is just a typedef for <B>void</B>, since the\r
-contents of the block are not externally defined. It is up to the caller to\r
-free the memory when it is no longer required.\r
-</P>\r
-<P>\r
-The size of a compiled pattern is roughly proportional to the length of the\r
-pattern string, except that each character class (other than those containing\r
-just a single character, negated or not) requires 33 bytes, and repeat\r
-quantifiers with a minimum greater than one or a bounded maximum cause the\r
-relevant portions of the compiled pattern to be replicated.\r
-</P>\r
-<P>\r
-The <I>options</I> argument contains independent bits that affect the\r
-compilation. It should be zero if no options are required. Some of the options,\r
-in particular, those that are compatible with Perl, can also be set and unset\r
-from within the pattern (see the detailed description of regular expressions\r
-below). For these options, the contents of the <I>options</I> argument specifies\r
-their initial settings at the start of compilation and execution. The\r
-PCRE_ANCHORED option can be set at the time of matching as well as at compile\r
-time.\r
-</P>\r
-<P>\r
-If <I>errptr</I> is NULL, <B>pcre_compile()</B> returns NULL immediately.\r
-Otherwise, if compilation of a pattern fails, <B>pcre_compile()</B> returns\r
-NULL, and sets the variable pointed to by <I>errptr</I> to point to a textual\r
-error message. The offset from the start of the pattern to the character where\r
-the error was discovered is placed in the variable pointed to by\r
-<I>erroffset</I>, which must not be NULL. If it is, an immediate error is given.\r
-</P>\r
-<P>\r
-If the final argument, <I>tableptr</I>, is NULL, PCRE uses a default set of\r
-character tables which are built when it is compiled, using the default C\r
-locale. Otherwise, <I>tableptr</I> must be the result of a call to\r
-<B>pcre_maketables()</B>. See the section on locale support below.\r
-</P>\r
-<P>\r
-The following option bits are defined in the header file:\r
-</P>\r
-<P>\r
-<PRE>\r
-  PCRE_ANCHORED\r
-</PRE>\r
-</P>\r
-<P>\r
-If this bit is set, the pattern is forced to be "anchored", that is, it is\r
-constrained to match only at the start of the string which is being searched\r
-(the "subject string"). This effect can also be achieved by appropriate\r
-constructs in the pattern itself, which is the only way to do it in Perl.\r
-</P>\r
-<P>\r
-<PRE>\r
-  PCRE_CASELESS\r
-</PRE>\r
-</P>\r
-<P>\r
-If this bit is set, letters in the pattern match both upper and lower case\r
-letters. It is equivalent to Perl's /i option.\r
-</P>\r
-<P>\r
-<PRE>\r
-  PCRE_DOLLAR_ENDONLY\r
-</PRE>\r
-</P>\r
-<P>\r
-If this bit is set, a dollar metacharacter in the pattern matches only at the\r
-end of the subject string. Without this option, a dollar also matches\r
-immediately before the final character if it is a newline (but not before any\r
-other newlines). The PCRE_DOLLAR_ENDONLY option is ignored if PCRE_MULTILINE is\r
-set. There is no equivalent to this option in Perl.\r
-</P>\r
-<P>\r
-<PRE>\r
-  PCRE_DOTALL\r
-</PRE>\r
-</P>\r
-<P>\r
-If this bit is set, a dot metacharater in the pattern matches all characters,\r
-including newlines. Without it, newlines are excluded. This option is\r
-equivalent to Perl's /s option. A negative class such as [^a] always matches a\r
-newline character, independent of the setting of this option.\r
-</P>\r
-<P>\r
-<PRE>\r
-  PCRE_EXTENDED\r
-</PRE>\r
-</P>\r
-<P>\r
-If this bit is set, whitespace data characters in the pattern are totally\r
-ignored except when escaped or inside a character class, and characters between\r
-an unescaped # outside a character class and the next newline character,\r
-inclusive, are also ignored. This is equivalent to Perl's /x option, and makes\r
-it possible to include comments inside complicated patterns. Note, however,\r
-that this applies only to data characters. Whitespace characters may never\r
-appear within special character sequences in a pattern, for example within the\r
-sequence (?( which introduces a conditional subpattern.\r
-</P>\r
-<P>\r
-<PRE>\r
-  PCRE_EXTRA\r
-</PRE>\r
-</P>\r
-<P>\r
-This option was invented in order to turn on additional functionality of PCRE\r
-that is incompatible with Perl, but it is currently of very little use. When\r
-set, any backslash in a pattern that is followed by a letter that has no\r
-special meaning causes an error, thus reserving these combinations for future\r
-expansion. By default, as in Perl, a backslash followed by a letter with no\r
-special meaning is treated as a literal. There are at present no other features\r
-controlled by this option. It can also be set by a (?X) option setting within a\r
-pattern.\r
-</P>\r
-<P>\r
-<PRE>\r
-  PCRE_MULTILINE\r
-</PRE>\r
-</P>\r
-<P>\r
-By default, PCRE treats the subject string as consisting of a single "line" of\r
-characters (even if it actually contains several newlines). The "start of line"\r
-metacharacter (^) matches only at the start of the string, while the "end of\r
-line" metacharacter ($) matches only at the end of the string, or before a\r
-terminating newline (unless PCRE_DOLLAR_ENDONLY is set). This is the same as\r
-Perl.\r
-</P>\r
-<P>\r
-When PCRE_MULTILINE it is set, the "start of line" and "end of line" constructs\r
-match immediately following or immediately before any newline in the subject\r
-string, respectively, as well as at the very start and end. This is equivalent\r
-to Perl's /m option. If there are no "\n" characters in a subject string, or\r
-no occurrences of ^ or $ in a pattern, setting PCRE_MULTILINE has no\r
-effect.\r
-</P>\r
-<P>\r
-<PRE>\r
-  PCRE_UNGREEDY\r
-</PRE>\r
-</P>\r
-<P>\r
-This option inverts the "greediness" of the quantifiers so that they are not\r
-greedy by default, but become greedy if followed by "?". It is not compatible\r
-with Perl. It can also be set by a (?U) option setting within the pattern.\r
-</P>\r
-<P>\r
-<PRE>\r
-  PCRE_UTF8\r
-</PRE>\r
-</P>\r
-<P>\r
-This option causes PCRE to regard both the pattern and the subject as strings\r
-of UTF-8 characters instead of just byte strings. However, it is available only\r
-if PCRE has been built to include UTF-8 support. If not, the use of this option\r
-provokes an error. Support for UTF-8 is new, experimental, and incomplete.\r
-Details of exactly what it entails are given below.\r
-</P>\r
-<LI><A NAME="SEC6" HREF="#TOC1">STUDYING A PATTERN</A>\r
-<P>\r
-When a pattern is going to be used several times, it is worth spending more\r
-time analyzing it in order to speed up the time taken for matching. The\r
-function <B>pcre_study()</B> takes a pointer to a compiled pattern as its first\r
-argument, and returns a pointer to a <B>pcre_extra</B> block (another <B>void</B>\r
-typedef) containing additional information about the pattern; this can be\r
-passed to <B>pcre_exec()</B>. If no additional information is available, NULL\r
-is returned.\r
-</P>\r
-<P>\r
-The second argument contains option bits. At present, no options are defined\r
-for <B>pcre_study()</B>, and this argument should always be zero.\r
-</P>\r
-<P>\r
-The third argument for <B>pcre_study()</B> is a pointer to an error message. If\r
-studying succeeds (even if no data is returned), the variable it points to is\r
-set to NULL. Otherwise it points to a textual error message.\r
-</P>\r
-<P>\r
-At present, studying a pattern is useful only for non-anchored patterns that do\r
-not have a single fixed starting character. A bitmap of possible starting\r
-characters is created.\r
-</P>\r
-<LI><A NAME="SEC7" HREF="#TOC1">LOCALE SUPPORT</A>\r
-<P>\r
-PCRE handles caseless matching, and determines whether characters are letters,\r
-digits, or whatever, by reference to a set of tables. The library contains a\r
-default set of tables which is created in the default C locale when PCRE is\r
-compiled. This is used when the final argument of <B>pcre_compile()</B> is NULL,\r
-and is sufficient for many applications.\r
-</P>\r
-<P>\r
-An alternative set of tables can, however, be supplied. Such tables are built\r
-by calling the <B>pcre_maketables()</B> function, which has no arguments, in the\r
-relevant locale. The result can then be passed to <B>pcre_compile()</B> as often\r
-as necessary. For example, to build and use tables that are appropriate for the\r
-French locale (where accented characters with codes greater than 128 are\r
-treated as letters), the following code could be used:\r
-</P>\r
-<P>\r
-<PRE>\r
-  setlocale(LC_CTYPE, "fr");\r
-  tables = pcre_maketables();\r
-  re = pcre_compile(..., tables);\r
-</PRE>\r
-</P>\r
-<P>\r
-The tables are built in memory that is obtained via <B>pcre_malloc</B>. The\r
-pointer that is passed to <B>pcre_compile</B> is saved with the compiled\r
-pattern, and the same tables are used via this pointer by <B>pcre_study()</B>\r
-and <B>pcre_exec()</B>. Thus for any single pattern, compilation, studying and\r
-matching all happen in the same locale, but different patterns can be compiled\r
-in different locales. It is the caller's responsibility to ensure that the\r
-memory containing the tables remains available for as long as it is needed.\r
-</P>\r
-<LI><A NAME="SEC8" HREF="#TOC1">INFORMATION ABOUT A PATTERN</A>\r
-<P>\r
-The <B>pcre_fullinfo()</B> function returns information about a compiled\r
-pattern. It replaces the obsolete <B>pcre_info()</B> function, which is\r
-nevertheless retained for backwards compability (and is documented below).\r
-</P>\r
-<P>\r
-The first argument for <B>pcre_fullinfo()</B> is a pointer to the compiled\r
-pattern. The second argument is the result of <B>pcre_study()</B>, or NULL if\r
-the pattern was not studied. The third argument specifies which piece of\r
-information is required, while the fourth argument is a pointer to a variable\r
-to receive the data. The yield of the function is zero for success, or one of\r
-the following negative numbers:\r
-</P>\r
-<P>\r
-<PRE>\r
-  PCRE_ERROR_NULL       the argument <I>code</I> was NULL\r
-                        the argument <I>where</I> was NULL\r
-  PCRE_ERROR_BADMAGIC   the "magic number" was not found\r
-  PCRE_ERROR_BADOPTION  the value of <I>what</I> was invalid\r
-</PRE>\r
-</P>\r
-<P>\r
-The possible values for the third argument are defined in <B>pcre.h</B>, and are\r
-as follows:\r
-</P>\r
-<P>\r
-<PRE>\r
-  PCRE_INFO_OPTIONS\r
-</PRE>\r
-</P>\r
-<P>\r
-Return a copy of the options with which the pattern was compiled. The fourth\r
-argument should point to au <B>unsigned long int</B> variable. These option bits\r
-are those specified in the call to <B>pcre_compile()</B>, modified by any\r
-top-level option settings within the pattern itself, and with the PCRE_ANCHORED\r
-bit forcibly set if the form of the pattern implies that it can match only at\r
-the start of a subject string.\r
-</P>\r
-<P>\r
-<PRE>\r
-  PCRE_INFO_SIZE\r
-</PRE>\r
-</P>\r
-<P>\r
-Return the size of the compiled pattern, that is, the value that was passed as\r
-the argument to <B>pcre_malloc()</B> when PCRE was getting memory in which to\r
-place the compiled data. The fourth argument should point to a <B>size_t</B>\r
-variable.\r
-</P>\r
-<P>\r
-<PRE>\r
-  PCRE_INFO_CAPTURECOUNT\r
-</PRE>\r
-</P>\r
-<P>\r
-Return the number of capturing subpatterns in the pattern. The fourth argument\r
-should point to an \fbint\fR variable.\r
-</P>\r
-<P>\r
-<PRE>\r
-  PCRE_INFO_BACKREFMAX\r
-</PRE>\r
-</P>\r
-<P>\r
-Return the number of the highest back reference in the pattern. The fourth\r
-argument should point to an <B>int</B> variable. Zero is returned if there are\r
-no back references.\r
-</P>\r
-<P>\r
-<PRE>\r
-  PCRE_INFO_FIRSTCHAR\r
-</PRE>\r
-</P>\r
-<P>\r
-Return information about the first character of any matched string, for a\r
-non-anchored pattern. If there is a fixed first character, e.g. from a pattern\r
-such as (cat|cow|coyote), it is returned in the integer pointed to by\r
-<I>where</I>. Otherwise, if either\r
-</P>\r
-<P>\r
-(a) the pattern was compiled with the PCRE_MULTILINE option, and every branch\r
-starts with "^", or\r
-</P>\r
-<P>\r
-(b) every branch of the pattern starts with ".*" and PCRE_DOTALL is not set\r
-(if it were set, the pattern would be anchored),\r
-</P>\r
-<P>\r
--1 is returned, indicating that the pattern matches only at the start of a\r
-subject string or after any "\n" within the string. Otherwise -2 is returned.\r
-For anchored patterns, -2 is returned.\r
-</P>\r
-<P>\r
-<PRE>\r
-  PCRE_INFO_FIRSTTABLE\r
-</PRE>\r
-</P>\r
-<P>\r
-If the pattern was studied, and this resulted in the construction of a 256-bit\r
-table indicating a fixed set of characters for the first character in any\r
-matching string, a pointer to the table is returned. Otherwise NULL is\r
-returned. The fourth argument should point to an <B>unsigned char *</B>\r
-variable.\r
-</P>\r
-<P>\r
-<PRE>\r
-  PCRE_INFO_LASTLITERAL\r
-</PRE>\r
-</P>\r
-<P>\r
-For a non-anchored pattern, return the value of the rightmost literal character\r
-which must exist in any matched string, other than at its start. The fourth\r
-argument should point to an <B>int</B> variable. If there is no such character,\r
-or if the pattern is anchored, -1 is returned. For example, for the pattern\r
-/a\d+z\d+/ the returned value is 'z'.\r
-</P>\r
-<P>\r
-The <B>pcre_info()</B> function is now obsolete because its interface is too\r
-restrictive to return all the available data about a compiled pattern. New\r
-programs should use <B>pcre_fullinfo()</B> instead. The yield of\r
-<B>pcre_info()</B> is the number of capturing subpatterns, or one of the\r
-following negative numbers:\r
-</P>\r
-<P>\r
-<PRE>\r
-  PCRE_ERROR_NULL       the argument <I>code</I> was NULL\r
-  PCRE_ERROR_BADMAGIC   the "magic number" was not found\r
-</PRE>\r
-</P>\r
-<P>\r
-If the <I>optptr</I> argument is not NULL, a copy of the options with which the\r
-pattern was compiled is placed in the integer it points to (see\r
-PCRE_INFO_OPTIONS above).\r
-</P>\r
-<P>\r
-If the pattern is not anchored and the <I>firstcharptr</I> argument is not NULL,\r
-it is used to pass back information about the first character of any matched\r
-string (see PCRE_INFO_FIRSTCHAR above).\r
-</P>\r
-<LI><A NAME="SEC9" HREF="#TOC1">MATCHING A PATTERN</A>\r
-<P>\r
-The function <B>pcre_exec()</B> is called to match a subject string against a\r
-pre-compiled pattern, which is passed in the <I>code</I> argument. If the\r
-pattern has been studied, the result of the study should be passed in the\r
-<I>extra</I> argument. Otherwise this must be NULL.\r
-</P>\r
-<P>\r
-The PCRE_ANCHORED option can be passed in the <I>options</I> argument, whose\r
-unused bits must be zero. However, if a pattern was compiled with\r
-PCRE_ANCHORED, or turned out to be anchored by virtue of its contents, it\r
-cannot be made unachored at matching time.\r
-</P>\r
-<P>\r
-There are also three further options that can be set only at matching time:\r
-</P>\r
-<P>\r
-<PRE>\r
-  PCRE_NOTBOL\r
-</PRE>\r
-</P>\r
-<P>\r
-The first character of the string is not the beginning of a line, so the\r
-circumflex metacharacter should not match before it. Setting this without\r
-PCRE_MULTILINE (at compile time) causes circumflex never to match.\r
-</P>\r
-<P>\r
-<PRE>\r
-  PCRE_NOTEOL\r
-</PRE>\r
-</P>\r
-<P>\r
-The end of the string is not the end of a line, so the dollar metacharacter\r
-should not match it nor (except in multiline mode) a newline immediately before\r
-it. Setting this without PCRE_MULTILINE (at compile time) causes dollar never\r
-to match.\r
-</P>\r
-<P>\r
-<PRE>\r
-  PCRE_NOTEMPTY\r
-</PRE>\r
-</P>\r
-<P>\r
-An empty string is not considered to be a valid match if this option is set. If\r
-there are alternatives in the pattern, they are tried. If all the alternatives\r
-match the empty string, the entire match fails. For example, if the pattern\r
-</P>\r
-<P>\r
-<PRE>\r
-  a?b?\r
-</PRE>\r
-</P>\r
-<P>\r
-is applied to a string not beginning with "a" or "b", it matches the empty\r
-string at the start of the subject. With PCRE_NOTEMPTY set, this match is not\r
-valid, so PCRE searches further into the string for occurrences of "a" or "b".\r
-</P>\r
-<P>\r
-Perl has no direct equivalent of PCRE_NOTEMPTY, but it does make a special case\r
-of a pattern match of the empty string within its <B>split()</B> function, and\r
-when using the /g modifier. It is possible to emulate Perl's behaviour after\r
-matching a null string by first trying the match again at the same offset with\r
-PCRE_NOTEMPTY set, and then if that fails by advancing the starting offset (see\r
-below) and trying an ordinary match again.\r
-</P>\r
-<P>\r
-The subject string is passed as a pointer in <I>subject</I>, a length in\r
-<I>length</I>, and a starting offset in <I>startoffset</I>. Unlike the pattern\r
-string, it may contain binary zero characters. When the starting offset is\r
-zero, the search for a match starts at the beginning of the subject, and this\r
-is by far the most common case.\r
-</P>\r
-<P>\r
-A non-zero starting offset is useful when searching for another match in the\r
-same subject by calling <B>pcre_exec()</B> again after a previous success.\r
-Setting <I>startoffset</I> differs from just passing over a shortened string and\r
-setting PCRE_NOTBOL in the case of a pattern that begins with any kind of\r
-lookbehind. For example, consider the pattern\r
-</P>\r
-<P>\r
-<PRE>\r
-  \Biss\B\r
-</PRE>\r
-</P>\r
-<P>\r
-which finds occurrences of "iss" in the middle of words. (\B matches only if\r
-the current position in the subject is not a word boundary.) When applied to\r
-the string "Mississipi" the first call to <B>pcre_exec()</B> finds the first\r
-occurrence. If <B>pcre_exec()</B> is called again with just the remainder of the\r
-subject, namely "issipi", it does not match, because \B is always false at the\r
-start of the subject, which is deemed to be a word boundary. However, if\r
-<B>pcre_exec()</B> is passed the entire string again, but with <I>startoffset</I>\r
-set to 4, it finds the second occurrence of "iss" because it is able to look\r
-behind the starting point to discover that it is preceded by a letter.\r
-</P>\r
-<P>\r
-If a non-zero starting offset is passed when the pattern is anchored, one\r
-attempt to match at the given offset is tried. This can only succeed if the\r
-pattern does not require the match to be at the start of the subject.\r
-</P>\r
-<P>\r
-In general, a pattern matches a certain portion of the subject, and in\r
-addition, further substrings from the subject may be picked out by parts of the\r
-pattern. Following the usage in Jeffrey Friedl's book, this is called\r
-"capturing" in what follows, and the phrase "capturing subpattern" is used for\r
-a fragment of a pattern that picks out a substring. PCRE supports several other\r
-kinds of parenthesized subpattern that do not cause substrings to be captured.\r
-</P>\r
-<P>\r
-Captured substrings are returned to the caller via a vector of integer offsets\r
-whose address is passed in <I>ovector</I>. The number of elements in the vector\r
-is passed in <I>ovecsize</I>. The first two-thirds of the vector is used to pass\r
-back captured substrings, each substring using a pair of integers. The\r
-remaining third of the vector is used as workspace by <B>pcre_exec()</B> while\r
-matching capturing subpatterns, and is not available for passing back\r
-information. The length passed in <I>ovecsize</I> should always be a multiple of\r
-three. If it is not, it is rounded down.\r
-</P>\r
-<P>\r
-When a match has been successful, information about captured substrings is\r
-returned in pairs of integers, starting at the beginning of <I>ovector</I>, and\r
-continuing up to two-thirds of its length at the most. The first element of a\r
-pair is set to the offset of the first character in a substring, and the second\r
-is set to the offset of the first character after the end of a substring. The\r
-first pair, <I>ovector[0]</I> and <I>ovector[1]</I>, identify the portion of the\r
-subject string matched by the entire pattern. The next pair is used for the\r
-first capturing subpattern, and so on. The value returned by <B>pcre_exec()</B>\r
-is the number of pairs that have been set. If there are no capturing\r
-subpatterns, the return value from a successful match is 1, indicating that\r
-just the first pair of offsets has been set.\r
-</P>\r
-<P>\r
-Some convenience functions are provided for extracting the captured substrings\r
-as separate strings. These are described in the following section.\r
-</P>\r
-<P>\r
-It is possible for an capturing subpattern number <I>n+1</I> to match some\r
-part of the subject when subpattern <I>n</I> has not been used at all. For\r
-example, if the string "abc" is matched against the pattern (a|(z))(bc)\r
-subpatterns 1 and 3 are matched, but 2 is not. When this happens, both offset\r
-values corresponding to the unused subpattern are set to -1.\r
-</P>\r
-<P>\r
-If a capturing subpattern is matched repeatedly, it is the last portion of the\r
-string that it matched that gets returned.\r
-</P>\r
-<P>\r
-If the vector is too small to hold all the captured substrings, it is used as\r
-far as possible (up to two-thirds of its length), and the function returns a\r
-value of zero. In particular, if the substring offsets are not of interest,\r
-<B>pcre_exec()</B> may be called with <I>ovector</I> passed as NULL and\r
-<I>ovecsize</I> as zero. However, if the pattern contains back references and\r
-the <I>ovector</I> isn't big enough to remember the related substrings, PCRE has\r
-to get additional memory for use during matching. Thus it is usually advisable\r
-to supply an <I>ovector</I>.\r
-</P>\r
-<P>\r
-Note that <B>pcre_info()</B> can be used to find out how many capturing\r
-subpatterns there are in a compiled pattern. The smallest size for\r
-<I>ovector</I> that will allow for <I>n</I> captured substrings in addition to\r
-the offsets of the substring matched by the whole pattern is (<I>n</I>+1)*3.\r
-</P>\r
-<P>\r
-If <B>pcre_exec()</B> fails, it returns a negative number. The following are\r
-defined in the header file:\r
-</P>\r
-<P>\r
-<PRE>\r
-  PCRE_ERROR_NOMATCH        (-1)\r
-</PRE>\r
-</P>\r
-<P>\r
-The subject string did not match the pattern.\r
-</P>\r
-<P>\r
-<PRE>\r
-  PCRE_ERROR_NULL           (-2)\r
-</PRE>\r
-</P>\r
-<P>\r
-Either <I>code</I> or <I>subject</I> was passed as NULL, or <I>ovector</I> was\r
-NULL and <I>ovecsize</I> was not zero.\r
-</P>\r
-<P>\r
-<PRE>\r
-  PCRE_ERROR_BADOPTION      (-3)\r
-</PRE>\r
-</P>\r
-<P>\r
-An unrecognized bit was set in the <I>options</I> argument.\r
-</P>\r
-<P>\r
-<PRE>\r
-  PCRE_ERROR_BADMAGIC       (-4)\r
-</PRE>\r
-</P>\r
-<P>\r
-PCRE stores a 4-byte "magic number" at the start of the compiled code, to catch\r
-the case when it is passed a junk pointer. This is the error it gives when the\r
-magic number isn't present.\r
-</P>\r
-<P>\r
-<PRE>\r
-  PCRE_ERROR_UNKNOWN_NODE   (-5)\r
-</PRE>\r
-</P>\r
-<P>\r
-While running the pattern match, an unknown item was encountered in the\r
-compiled pattern. This error could be caused by a bug in PCRE or by overwriting\r
-of the compiled pattern.\r
-</P>\r
-<P>\r
-<PRE>\r
-  PCRE_ERROR_NOMEMORY       (-6)\r
-</PRE>\r
-</P>\r
-<P>\r
-If a pattern contains back references, but the <I>ovector</I> that is passed to\r
-<B>pcre_exec()</B> is not big enough to remember the referenced substrings, PCRE\r
-gets a block of memory at the start of matching to use for this purpose. If the\r
-call via <B>pcre_malloc()</B> fails, this error is given. The memory is freed at\r
-the end of matching.\r
-</P>\r
-<LI><A NAME="SEC10" HREF="#TOC1">EXTRACTING CAPTURED SUBSTRINGS</A>\r
-<P>\r
-Captured substrings can be accessed directly by using the offsets returned by\r
-<B>pcre_exec()</B> in <I>ovector</I>. For convenience, the functions\r
-<B>pcre_copy_substring()</B>, <B>pcre_get_substring()</B>, and\r
-<B>pcre_get_substring_list()</B> are provided for extracting captured substrings\r
-as new, separate, zero-terminated strings. A substring that contains a binary\r
-zero is correctly extracted and has a further zero added on the end, but the\r
-result does not, of course, function as a C string.\r
-</P>\r
-<P>\r
-The first three arguments are the same for all three functions: <I>subject</I>\r
-is the subject string which has just been successfully matched, <I>ovector</I>\r
-is a pointer to the vector of integer offsets that was passed to\r
-<B>pcre_exec()</B>, and <I>stringcount</I> is the number of substrings that\r
-were captured by the match, including the substring that matched the entire\r
-regular expression. This is the value returned by <B>pcre_exec</B> if it\r
-is greater than zero. If <B>pcre_exec()</B> returned zero, indicating that it\r
-ran out of space in <I>ovector</I>, the value passed as <I>stringcount</I> should\r
-be the size of the vector divided by three.\r
-</P>\r
-<P>\r
-The functions <B>pcre_copy_substring()</B> and <B>pcre_get_substring()</B>\r
-extract a single substring, whose number is given as <I>stringnumber</I>. A\r
-value of zero extracts the substring that matched the entire pattern, while\r
-higher values extract the captured substrings. For <B>pcre_copy_substring()</B>,\r
-the string is placed in <I>buffer</I>, whose length is given by\r
-<I>buffersize</I>, while for <B>pcre_get_substring()</B> a new block of memory is\r
-obtained via <B>pcre_malloc</B>, and its address is returned via\r
-<I>stringptr</I>. The yield of the function is the length of the string, not\r
-including the terminating zero, or one of\r
-</P>\r
-<P>\r
-<PRE>\r
-  PCRE_ERROR_NOMEMORY       (-6)\r
-</PRE>\r
-</P>\r
-<P>\r
-The buffer was too small for <B>pcre_copy_substring()</B>, or the attempt to get\r
-memory failed for <B>pcre_get_substring()</B>.\r
-</P>\r
-<P>\r
-<PRE>\r
-  PCRE_ERROR_NOSUBSTRING    (-7)\r
-</PRE>\r
-</P>\r
-<P>\r
-There is no substring whose number is <I>stringnumber</I>.\r
-</P>\r
-<P>\r
-The <B>pcre_get_substring_list()</B> function extracts all available substrings\r
-and builds a list of pointers to them. All this is done in a single block of\r
-memory which is obtained via <B>pcre_malloc</B>. The address of the memory block\r
-is returned via <I>listptr</I>, which is also the start of the list of string\r
-pointers. The end of the list is marked by a NULL pointer. The yield of the\r
-function is zero if all went well, or\r
-</P>\r
-<P>\r
-<PRE>\r
-  PCRE_ERROR_NOMEMORY       (-6)\r
-</PRE>\r
-</P>\r
-<P>\r
-if the attempt to get the memory block failed.\r
-</P>\r
-<P>\r
-When any of these functions encounter a substring that is unset, which can\r
-happen when capturing subpattern number <I>n+1</I> matches some part of the\r
-subject, but subpattern <I>n</I> has not been used at all, they return an empty\r
-string. This can be distinguished from a genuine zero-length substring by\r
-inspecting the appropriate offset in <I>ovector</I>, which is negative for unset\r
-substrings.\r
-</P>\r
-<P>\r
-The two convenience functions <B>pcre_free_substring()</B> and\r
-<B>pcre_free_substring_list()</B> can be used to free the memory returned by\r
-a previous call of <B>pcre_get_substring()</B> or\r
-<B>pcre_get_substring_list()</B>, respectively. They do nothing more than call\r
-the function pointed to by <B>pcre_free</B>, which of course could be called\r
-directly from a C program. However, PCRE is used in some situations where it is\r
-linked via a special interface to another programming language which cannot use\r
-<B>pcre_free</B> directly; it is for these cases that the functions are\r
-provided.\r
-</P>\r
-<LI><A NAME="SEC11" HREF="#TOC1">LIMITATIONS</A>\r
-<P>\r
-There are some size limitations in PCRE but it is hoped that they will never in\r
-practice be relevant.\r
-The maximum length of a compiled pattern is 65539 (sic) bytes.\r
-All values in repeating quantifiers must be less than 65536.\r
-The maximum number of capturing subpatterns is 99.\r
-The maximum number of all parenthesized subpatterns, including capturing\r
-subpatterns, assertions, and other types of subpattern, is 200.\r
-</P>\r
-<P>\r
-The maximum length of a subject string is the largest positive number that an\r
-integer variable can hold. However, PCRE uses recursion to handle subpatterns\r
-and indefinite repetition. This means that the available stack space may limit\r
-the size of a subject string that can be processed by certain patterns.\r
-</P>\r
-<LI><A NAME="SEC12" HREF="#TOC1">DIFFERENCES FROM PERL</A>\r
-<P>\r
-The differences described here are with respect to Perl 5.005.\r
-</P>\r
-<P>\r
-1. By default, a whitespace character is any character that the C library\r
-function <B>isspace()</B> recognizes, though it is possible to compile PCRE with\r
-alternative character type tables. Normally <B>isspace()</B> matches space,\r
-formfeed, newline, carriage return, horizontal tab, and vertical tab. Perl 5\r
-no longer includes vertical tab in its set of whitespace characters. The \v\r
-escape that was in the Perl documentation for a long time was never in fact\r
-recognized. However, the character itself was treated as whitespace at least\r
-up to 5.002. In 5.004 and 5.005 it does not match \s.\r
-</P>\r
-<P>\r
-2. PCRE does not allow repeat quantifiers on lookahead assertions. Perl permits\r
-them, but they do not mean what you might think. For example, (?!a){3} does\r
-not assert that the next three characters are not "a". It just asserts that the\r
-next character is not "a" three times.\r
-</P>\r
-<P>\r
-3. Capturing subpatterns that occur inside negative lookahead assertions are\r
-counted, but their entries in the offsets vector are never set. Perl sets its\r
-numerical variables from any such patterns that are matched before the\r
-assertion fails to match something (thereby succeeding), but only if the\r
-negative lookahead assertion contains just one branch.\r
-</P>\r
-<P>\r
-4. Though binary zero characters are supported in the subject string, they are\r
-not allowed in a pattern string because it is passed as a normal C string,\r
-terminated by zero. The escape sequence "\0" can be used in the pattern to\r
-represent a binary zero.\r
-</P>\r
-<P>\r
-5. The following Perl escape sequences are not supported: \l, \u, \L, \U,\r
-\E, \Q. In fact these are implemented by Perl's general string-handling and\r
-are not part of its pattern matching engine.\r
-</P>\r
-<P>\r
-6. The Perl \G assertion is not supported as it is not relevant to single\r
-pattern matches.\r
-</P>\r
-<P>\r
-7. Fairly obviously, PCRE does not support the (?{code}) and (?p{code})\r
-constructions. However, there is some experimental support for recursive\r
-patterns using the non-Perl item (?R).\r
-</P>\r
-<P>\r
-8. There are at the time of writing some oddities in Perl 5.005_02 concerned\r
-with the settings of captured strings when part of a pattern is repeated. For\r
-example, matching "aba" against the pattern /^(a(b)?)+$/ sets $2 to the value\r
-"b", but matching "aabbaa" against /^(aa(bb)?)+$/ leaves $2 unset. However, if\r
-the pattern is changed to /^(aa(b(b))?)+$/ then $2 (and $3) are set.\r
-</P>\r
-<P>\r
-In Perl 5.004 $2 is set in both cases, and that is also true of PCRE. If in the\r
-future Perl changes to a consistent state that is different, PCRE may change to\r
-follow.\r
-</P>\r
-<P>\r
-9. Another as yet unresolved discrepancy is that in Perl 5.005_02 the pattern\r
-/^(a)?(?(1)a|b)+$/ matches the string "a", whereas in PCRE it does not.\r
-However, in both Perl and PCRE /^(a)?a/ matched against "a" leaves $1 unset.\r
-</P>\r
-<P>\r
-10. PCRE provides some extensions to the Perl regular expression facilities:\r
-</P>\r
-<P>\r
-(a) Although lookbehind assertions must match fixed length strings, each\r
-alternative branch of a lookbehind assertion can match a different length of\r
-string. Perl 5.005 requires them all to have the same length.\r
-</P>\r
-<P>\r
-(b) If PCRE_DOLLAR_ENDONLY is set and PCRE_MULTILINE is not set, the $ meta-\r
-character matches only at the very end of the string.\r
-</P>\r
-<P>\r
-(c) If PCRE_EXTRA is set, a backslash followed by a letter with no special\r
-meaning is faulted.\r
-</P>\r
-<P>\r
-(d) If PCRE_UNGREEDY is set, the greediness of the repetition quantifiers is\r
-inverted, that is, by default they are not greedy, but if followed by a\r
-question mark they are.\r
-</P>\r
-<P>\r
-(e) PCRE_ANCHORED can be used to force a pattern to be tried only at the start\r
-of the subject.\r
-</P>\r
-<P>\r
-(f) The PCRE_NOTBOL, PCRE_NOTEOL, and PCRE_NOTEMPTY options for\r
-<B>pcre_exec()</B> have no Perl equivalents.\r
-</P>\r
-<P>\r
-(g) The (?R) construct allows for recursive pattern matching (Perl 5.6 can do\r
-this using the (?p{code}) construct, which PCRE cannot of course support.)\r
-</P>\r
-<LI><A NAME="SEC13" HREF="#TOC1">REGULAR EXPRESSION DETAILS</A>\r
-<P>\r
-The syntax and semantics of the regular expressions supported by PCRE are\r
-described below. Regular expressions are also described in the Perl\r
-documentation and in a number of other books, some of which have copious\r
-examples. Jeffrey Friedl's "Mastering Regular Expressions", published by\r
-O'Reilly (ISBN 1-56592-257), covers them in great detail.\r
-</P>\r
-<P>\r
-The description here is intended as reference documentation. The basic\r
-operation of PCRE is on strings of bytes. However, there is the beginnings of\r
-some support for UTF-8 character strings. To use this support you must\r
-configure PCRE to include it, and then call <B>pcre_compile()</B> with the\r
-PCRE_UTF8 option. How this affects the pattern matching is described in the\r
-final section of this document.\r
-</P>\r
-<P>\r
-A regular expression is a pattern that is matched against a subject string from\r
-left to right. Most characters stand for themselves in a pattern, and match the\r
-corresponding characters in the subject. As a trivial example, the pattern\r
-</P>\r
-<P>\r
-<PRE>\r
-  The quick brown fox\r
-</PRE>\r
-</P>\r
-<P>\r
-matches a portion of a subject string that is identical to itself. The power of\r
-regular expressions comes from the ability to include alternatives and\r
-repetitions in the pattern. These are encoded in the pattern by the use of\r
-<I>meta-characters</I>, which do not stand for themselves but instead are\r
-interpreted in some special way.\r
-</P>\r
-<P>\r
-There are two different sets of meta-characters: those that are recognized\r
-anywhere in the pattern except within square brackets, and those that are\r
-recognized in square brackets. Outside square brackets, the meta-characters are\r
-as follows:\r
-</P>\r
-<P>\r
-<PRE>\r
-  \      general escape character with several uses\r
-  ^      assert start of subject (or line, in multiline mode)\r
-  $      assert end of subject (or line, in multiline mode)\r
-  .      match any character except newline (by default)\r
-  [      start character class definition\r
-  |      start of alternative branch\r
-  (      start subpattern\r
-  )      end subpattern\r
-  ?      extends the meaning of (\r
-         also 0 or 1 quantifier\r
-         also quantifier minimizer\r
-  *      0 or more quantifier\r
-  +      1 or more quantifier\r
-  {      start min/max quantifier\r
-</PRE>\r
-</P>\r
-<P>\r
-Part of a pattern that is in square brackets is called a "character class". In\r
-a character class the only meta-characters are:\r
-</P>\r
-<P>\r
-<PRE>\r
-  \      general escape character\r
-  ^      negate the class, but only if the first character\r
-  -      indicates character range\r
-  ]      terminates the character class\r
-</PRE>\r
-</P>\r
-<P>\r
-The following sections describe the use of each of the meta-characters.\r
-</P>\r
-<LI><A NAME="SEC14" HREF="#TOC1">BACKSLASH</A>\r
-<P>\r
-The backslash character has several uses. Firstly, if it is followed by a\r
-non-alphameric character, it takes away any special meaning that character may\r
-have. This use of backslash as an escape character applies both inside and\r
-outside character classes.\r
-</P>\r
-<P>\r
-For example, if you want to match a "*" character, you write "\*" in the\r
-pattern. This applies whether or not the following character would otherwise be\r
-interpreted as a meta-character, so it is always safe to precede a\r
-non-alphameric with "\" to specify that it stands for itself. In particular,\r
-if you want to match a backslash, you write "\\".\r
-</P>\r
-<P>\r
-If a pattern is compiled with the PCRE_EXTENDED option, whitespace in the\r
-pattern (other than in a character class) and characters between a "#" outside\r
-a character class and the next newline character are ignored. An escaping\r
-backslash can be used to include a whitespace or "#" character as part of the\r
-pattern.\r
-</P>\r
-<P>\r
-A second use of backslash provides a way of encoding non-printing characters\r
-in patterns in a visible manner. There is no restriction on the appearance of\r
-non-printing characters, apart from the binary zero that terminates a pattern,\r
-but when a pattern is being prepared by text editing, it is usually easier to\r
-use one of the following escape sequences than the binary character it\r
-represents:\r
-</P>\r
-<P>\r
-<PRE>\r
-  \a     alarm, that is, the BEL character (hex 07)\r
-  \cx    "control-x", where x is any character\r
-  \e     escape (hex 1B)\r
-  \f     formfeed (hex 0C)\r
-  \n     newline (hex 0A)\r
-  \r     carriage return (hex 0D)\r
-  \t     tab (hex 09)\r
-  \xhh   character with hex code hh\r
-  \ddd   character with octal code ddd, or backreference\r
-</PRE>\r
-</P>\r
-<P>\r
-The precise effect of "\cx" is as follows: if "x" is a lower case letter, it\r
-is converted to upper case. Then bit 6 of the character (hex 40) is inverted.\r
-Thus "\cz" becomes hex 1A, but "\c{" becomes hex 3B, while "\c;" becomes hex\r
-7B.\r
-</P>\r
-<P>\r
-After "\x", up to two hexadecimal digits are read (letters can be in upper or\r
-lower case).\r
-</P>\r
-<P>\r
-After "\0" up to two further octal digits are read. In both cases, if there\r
-are fewer than two digits, just those that are present are used. Thus the\r
-sequence "\0\x\07" specifies two binary zeros followed by a BEL character.\r
-Make sure you supply two digits after the initial zero if the character that\r
-follows is itself an octal digit.\r
-</P>\r
-<P>\r
-The handling of a backslash followed by a digit other than 0 is complicated.\r
-Outside a character class, PCRE reads it and any following digits as a decimal\r
-number. If the number is less than 10, or if there have been at least that many\r
-previous capturing left parentheses in the expression, the entire sequence is\r
-taken as a <I>back reference</I>. A description of how this works is given\r
-later, following the discussion of parenthesized subpatterns.\r
-</P>\r
-<P>\r
-Inside a character class, or if the decimal number is greater than 9 and there\r
-have not been that many capturing subpatterns, PCRE re-reads up to three octal\r
-digits following the backslash, and generates a single byte from the least\r
-significant 8 bits of the value. Any subsequent digits stand for themselves.\r
-For example:\r
-</P>\r
-<P>\r
-<PRE>\r
-  \040   is another way of writing a space\r
-  \40    is the same, provided there are fewer than 40\r
-            previous capturing subpatterns\r
-  \7     is always a back reference\r
-  \11    might be a back reference, or another way of\r
-            writing a tab\r
-  \011   is always a tab\r
-  \0113  is a tab followed by the character "3"\r
-  \113   is the character with octal code 113 (since there\r
-            can be no more than 99 back references)\r
-  \377   is a byte consisting entirely of 1 bits\r
-  \81    is either a back reference, or a binary zero\r
-            followed by the two characters "8" and "1"\r
-</PRE>\r
-</P>\r
-<P>\r
-Note that octal values of 100 or greater must not be introduced by a leading\r
-zero, because no more than three octal digits are ever read.\r
-</P>\r
-<P>\r
-All the sequences that define a single byte value can be used both inside and\r
-outside character classes. In addition, inside a character class, the sequence\r
-"\b" is interpreted as the backspace character (hex 08). Outside a character\r
-class it has a different meaning (see below).\r
-</P>\r
-<P>\r
-The third use of backslash is for specifying generic character types:\r
-</P>\r
-<P>\r
-<PRE>\r
-  \d     any decimal digit\r
-  \D     any character that is not a decimal digit\r
-  \s     any whitespace character\r
-  \S     any character that is not a whitespace character\r
-  \w     any "word" character\r
-  \W     any "non-word" character\r
-</PRE>\r
-</P>\r
-<P>\r
-Each pair of escape sequences partitions the complete set of characters into\r
-two disjoint sets. Any given character matches one, and only one, of each pair.\r
-</P>\r
-<P>\r
-A "word" character is any letter or digit or the underscore character, that is,\r
-any character which can be part of a Perl "word". The definition of letters and\r
-digits is controlled by PCRE's character tables, and may vary if locale-\r
-specific matching is taking place (see "Locale support" above). For example, in\r
-the "fr" (French) locale, some character codes greater than 128 are used for\r
-accented letters, and these are matched by \w.\r
-</P>\r
-<P>\r
-These character type sequences can appear both inside and outside character\r
-classes. They each match one character of the appropriate type. If the current\r
-matching point is at the end of the subject string, all of them fail, since\r
-there is no character to match.\r
-</P>\r
-<P>\r
-The fourth use of backslash is for certain simple assertions. An assertion\r
-specifies a condition that has to be met at a particular point in a match,\r
-without consuming any characters from the subject string. The use of\r
-subpatterns for more complicated assertions is described below. The backslashed\r
-assertions are\r
-</P>\r
-<P>\r
-<PRE>\r
-  \b     word boundary\r
-  \B     not a word boundary\r
-  \A     start of subject (independent of multiline mode)\r
-  \Z     end of subject or newline at end (independent of multiline mode)\r
-  \z     end of subject (independent of multiline mode)\r
-</PRE>\r
-</P>\r
-<P>\r
-These assertions may not appear in character classes (but note that "\b" has a\r
-different meaning, namely the backspace character, inside a character class).\r
-</P>\r
-<P>\r
-A word boundary is a position in the subject string where the current character\r
-and the previous character do not both match \w or \W (i.e. one matches\r
-\w and the other matches \W), or the start or end of the string if the\r
-first or last character matches \w, respectively.\r
-</P>\r
-<P>\r
-The \A, \Z, and \z assertions differ from the traditional circumflex and\r
-dollar (described below) in that they only ever match at the very start and end\r
-of the subject string, whatever options are set. They are not affected by the\r
-PCRE_NOTBOL or PCRE_NOTEOL options. If the <I>startoffset</I> argument of\r
-<B>pcre_exec()</B> is non-zero, \A can never match. The difference between \Z\r
-and \z is that \Z matches before a newline that is the last character of the\r
-string as well as at the end of the string, whereas \z matches only at the\r
-end.\r
-</P>\r
-<LI><A NAME="SEC15" HREF="#TOC1">CIRCUMFLEX AND DOLLAR</A>\r
-<P>\r
-Outside a character class, in the default matching mode, the circumflex\r
-character is an assertion which is true only if the current matching point is\r
-at the start of the subject string. If the <I>startoffset</I> argument of\r
-<B>pcre_exec()</B> is non-zero, circumflex can never match. Inside a character\r
-class, circumflex has an entirely different meaning (see below).\r
-</P>\r
-<P>\r
-Circumflex need not be the first character of the pattern if a number of\r
-alternatives are involved, but it should be the first thing in each alternative\r
-in which it appears if the pattern is ever to match that branch. If all\r
-possible alternatives start with a circumflex, that is, if the pattern is\r
-constrained to match only at the start of the subject, it is said to be an\r
-"anchored" pattern. (There are also other constructs that can cause a pattern\r
-to be anchored.)\r
-</P>\r
-<P>\r
-A dollar character is an assertion which is true only if the current matching\r
-point is at the end of the subject string, or immediately before a newline\r
-character that is the last character in the string (by default). Dollar need\r
-not be the last character of the pattern if a number of alternatives are\r
-involved, but it should be the last item in any branch in which it appears.\r
-Dollar has no special meaning in a character class.\r
-</P>\r
-<P>\r
-The meaning of dollar can be changed so that it matches only at the very end of\r
-the string, by setting the PCRE_DOLLAR_ENDONLY option at compile or matching\r
-time. This does not affect the \Z assertion.\r
-</P>\r
-<P>\r
-The meanings of the circumflex and dollar characters are changed if the\r
-PCRE_MULTILINE option is set. When this is the case, they match immediately\r
-after and immediately before an internal "\n" character, respectively, in\r
-addition to matching at the start and end of the subject string. For example,\r
-the pattern /^abc$/ matches the subject string "def\nabc" in multiline mode,\r
-but not otherwise. Consequently, patterns that are anchored in single line mode\r
-because all branches start with "^" are not anchored in multiline mode, and a\r
-match for circumflex is possible when the <I>startoffset</I> argument of\r
-<B>pcre_exec()</B> is non-zero. The PCRE_DOLLAR_ENDONLY option is ignored if\r
-PCRE_MULTILINE is set.\r
-</P>\r
-<P>\r
-Note that the sequences \A, \Z, and \z can be used to match the start and\r
-end of the subject in both modes, and if all branches of a pattern start with\r
-\A is it always anchored, whether PCRE_MULTILINE is set or not.\r
-</P>\r
-<LI><A NAME="SEC16" HREF="#TOC1">FULL STOP (PERIOD, DOT)</A>\r
-<P>\r
-Outside a character class, a dot in the pattern matches any one character in\r
-the subject, including a non-printing character, but not (by default) newline.\r
-If the PCRE_DOTALL option is set, dots match newlines as well. The handling of\r
-dot is entirely independent of the handling of circumflex and dollar, the only\r
-relationship being that they both involve newline characters. Dot has no\r
-special meaning in a character class.\r
-</P>\r
-<LI><A NAME="SEC17" HREF="#TOC1">SQUARE BRACKETS</A>\r
-<P>\r
-An opening square bracket introduces a character class, terminated by a closing\r
-square bracket. A closing square bracket on its own is not special. If a\r
-closing square bracket is required as a member of the class, it should be the\r
-first data character in the class (after an initial circumflex, if present) or\r
-escaped with a backslash.\r
-</P>\r
-<P>\r
-A character class matches a single character in the subject; the character must\r
-be in the set of characters defined by the class, unless the first character in\r
-the class is a circumflex, in which case the subject character must not be in\r
-the set defined by the class. If a circumflex is actually required as a member\r
-of the class, ensure it is not the first character, or escape it with a\r
-backslash.\r
-</P>\r
-<P>\r
-For example, the character class [aeiou] matches any lower case vowel, while\r
-[^aeiou] matches any character that is not a lower case vowel. Note that a\r
-circumflex is just a convenient notation for specifying the characters which\r
-are in the class by enumerating those that are not. It is not an assertion: it\r
-still consumes a character from the subject string, and fails if the current\r
-pointer is at the end of the string.\r
-</P>\r
-<P>\r
-When caseless matching is set, any letters in a class represent both their\r
-upper case and lower case versions, so for example, a caseless [aeiou] matches\r
-"A" as well as "a", and a caseless [^aeiou] does not match "A", whereas a\r
-caseful version would.\r
-</P>\r
-<P>\r
-The newline character is never treated in any special way in character classes,\r
-whatever the setting of the PCRE_DOTALL or PCRE_MULTILINE options is. A class\r
-such as [^a] will always match a newline.\r
-</P>\r
-<P>\r
-The minus (hyphen) character can be used to specify a range of characters in a\r
-character class. For example, [d-m] matches any letter between d and m,\r
-inclusive. If a minus character is required in a class, it must be escaped with\r
-a backslash or appear in a position where it cannot be interpreted as\r
-indicating a range, typically as the first or last character in the class.\r
-</P>\r
-<P>\r
-It is not possible to have the literal character "]" as the end character of a\r
-range. A pattern such as [W-]46] is interpreted as a class of two characters\r
-("W" and "-") followed by a literal string "46]", so it would match "W46]" or\r
-"-46]". However, if the "]" is escaped with a backslash it is interpreted as\r
-the end of range, so [W-\]46] is interpreted as a single class containing a\r
-range followed by two separate characters. The octal or hexadecimal\r
-representation of "]" can also be used to end a range.\r
-</P>\r
-<P>\r
-Ranges operate in ASCII collating sequence. They can also be used for\r
-characters specified numerically, for example [\000-\037]. If a range that\r
-includes letters is used when caseless matching is set, it matches the letters\r
-in either case. For example, [W-c] is equivalent to [][\^_`wxyzabc], matched\r
-caselessly, and if character tables for the "fr" locale are in use,\r
-[\xc8-\xcb] matches accented E characters in both cases.\r
-</P>\r
-<P>\r
-The character types \d, \D, \s, \S, \w, and \W may also appear in a\r
-character class, and add the characters that they match to the class. For\r
-example, [\dABCDEF] matches any hexadecimal digit. A circumflex can\r
-conveniently be used with the upper case character types to specify a more\r
-restricted set of characters than the matching lower case type. For example,\r
-the class [^\W_] matches any letter or digit, but not underscore.\r
-</P>\r
-<P>\r
-All non-alphameric characters other than \, -, ^ (at the start) and the\r
-terminating ] are non-special in character classes, but it does no harm if they\r
-are escaped.\r
-</P>\r
-<LI><A NAME="SEC18" HREF="#TOC1">POSIX CHARACTER CLASSES</A>\r
-<P>\r
-Perl 5.6 (not yet released at the time of writing) is going to support the\r
-POSIX notation for character classes, which uses names enclosed by [: and :]\r
-within the enclosing square brackets. PCRE supports this notation. For example,\r
-</P>\r
-<P>\r
-<PRE>\r
-  [01[:alpha:]%]\r
-</PRE>\r
-</P>\r
-<P>\r
-matches "0", "1", any alphabetic character, or "%". The supported class names\r
-are\r
-</P>\r
-<P>\r
-<PRE>\r
-  alnum    letters and digits\r
-  alpha    letters\r
-  ascii    character codes 0 - 127\r
-  cntrl    control characters\r
-  digit    decimal digits (same as \d)\r
-  graph    printing characters, excluding space\r
-  lower    lower case letters\r
-  print    printing characters, including space\r
-  punct    printing characters, excluding letters and digits\r
-  space    white space (same as \s)\r
-  upper    upper case letters\r
-  word     "word" characters (same as \w)\r
-  xdigit   hexadecimal digits\r
-</PRE>\r
-</P>\r
-<P>\r
-The names "ascii" and "word" are Perl extensions. Another Perl extension is\r
-negation, which is indicated by a ^ character after the colon. For example,\r
-</P>\r
-<P>\r
-<PRE>\r
-  [12[:^digit:]]\r
-</PRE>\r
-</P>\r
-<P>\r
-matches "1", "2", or any non-digit. PCRE (and Perl) also recogize the POSIX\r
-syntax [.ch.] and [=ch=] where "ch" is a "collating element", but these are not\r
-supported, and an error is given if they are encountered.\r
-</P>\r
-<LI><A NAME="SEC19" HREF="#TOC1">VERTICAL BAR</A>\r
-<P>\r
-Vertical bar characters are used to separate alternative patterns. For example,\r
-the pattern\r
-</P>\r
-<P>\r
-<PRE>\r
-  gilbert|sullivan\r
-</PRE>\r
-</P>\r
-<P>\r
-matches either "gilbert" or "sullivan". Any number of alternatives may appear,\r
-and an empty alternative is permitted (matching the empty string).\r
-The matching process tries each alternative in turn, from left to right,\r
-and the first one that succeeds is used. If the alternatives are within a\r
-subpattern (defined below), "succeeds" means matching the rest of the main\r
-pattern as well as the alternative in the subpattern.\r
-</P>\r
-<LI><A NAME="SEC20" HREF="#TOC1">INTERNAL OPTION SETTING</A>\r
-<P>\r
-The settings of PCRE_CASELESS, PCRE_MULTILINE, PCRE_DOTALL, and PCRE_EXTENDED\r
-can be changed from within the pattern by a sequence of Perl option letters\r
-enclosed between "(?" and ")". The option letters are\r
-</P>\r
-<P>\r
-<PRE>\r
-  i  for PCRE_CASELESS\r
-  m  for PCRE_MULTILINE\r
-  s  for PCRE_DOTALL\r
-  x  for PCRE_EXTENDED\r
-</PRE>\r
-</P>\r
-<P>\r
-For example, (?im) sets caseless, multiline matching. It is also possible to\r
-unset these options by preceding the letter with a hyphen, and a combined\r
-setting and unsetting such as (?im-sx), which sets PCRE_CASELESS and\r
-PCRE_MULTILINE while unsetting PCRE_DOTALL and PCRE_EXTENDED, is also\r
-permitted. If a letter appears both before and after the hyphen, the option is\r
-unset.\r
-</P>\r
-<P>\r
-The scope of these option changes depends on where in the pattern the setting\r
-occurs. For settings that are outside any subpattern (defined below), the\r
-effect is the same as if the options were set or unset at the start of\r
-matching. The following patterns all behave in exactly the same way:\r
-</P>\r
-<P>\r
-<PRE>\r
-  (?i)abc\r
-  a(?i)bc\r
-  ab(?i)c\r
-  abc(?i)\r
-</PRE>\r
-</P>\r
-<P>\r
-which in turn is the same as compiling the pattern abc with PCRE_CASELESS set.\r
-In other words, such "top level" settings apply to the whole pattern (unless\r
-there are other changes inside subpatterns). If there is more than one setting\r
-of the same option at top level, the rightmost setting is used.\r
-</P>\r
-<P>\r
-If an option change occurs inside a subpattern, the effect is different. This\r
-is a change of behaviour in Perl 5.005. An option change inside a subpattern\r
-affects only that part of the subpattern that follows it, so\r
-</P>\r
-<P>\r
-<PRE>\r
-  (a(?i)b)c\r
-</PRE>\r
-</P>\r
-<P>\r
-matches abc and aBc and no other strings (assuming PCRE_CASELESS is not used).\r
-By this means, options can be made to have different settings in different\r
-parts of the pattern. Any changes made in one alternative do carry on\r
-into subsequent branches within the same subpattern. For example,\r
-</P>\r
-<P>\r
-<PRE>\r
-  (a(?i)b|c)\r
-</PRE>\r
-</P>\r
-<P>\r
-matches "ab", "aB", "c", and "C", even though when matching "C" the first\r
-branch is abandoned before the option setting. This is because the effects of\r
-option settings happen at compile time. There would be some very weird\r
-behaviour otherwise.\r
-</P>\r
-<P>\r
-The PCRE-specific options PCRE_UNGREEDY and PCRE_EXTRA can be changed in the\r
-same way as the Perl-compatible options by using the characters U and X\r
-respectively. The (?X) flag setting is special in that it must always occur\r
-earlier in the pattern than any of the additional features it turns on, even\r
-when it is at top level. It is best put at the start.\r
-</P>\r
-<LI><A NAME="SEC21" HREF="#TOC1">SUBPATTERNS</A>\r
-<P>\r
-Subpatterns are delimited by parentheses (round brackets), which can be nested.\r
-Marking part of a pattern as a subpattern does two things:\r
-</P>\r
-<P>\r
-1. It localizes a set of alternatives. For example, the pattern\r
-</P>\r
-<P>\r
-<PRE>\r
-  cat(aract|erpillar|)\r
-</PRE>\r
-</P>\r
-<P>\r
-matches one of the words "cat", "cataract", or "caterpillar". Without the\r
-parentheses, it would match "cataract", "erpillar" or the empty string.\r
-</P>\r
-<P>\r
-2. It sets up the subpattern as a capturing subpattern (as defined above).\r
-When the whole pattern matches, that portion of the subject string that matched\r
-the subpattern is passed back to the caller via the <I>ovector</I> argument of\r
-<B>pcre_exec()</B>. Opening parentheses are counted from left to right (starting\r
-from 1) to obtain the numbers of the capturing subpatterns.\r
-</P>\r
-<P>\r
-For example, if the string "the red king" is matched against the pattern\r
-</P>\r
-<P>\r
-<PRE>\r
-  the ((red|white) (king|queen))\r
-</PRE>\r
-</P>\r
-<P>\r
-the captured substrings are "red king", "red", and "king", and are numbered 1,\r
-2, and 3.\r
-</P>\r
-<P>\r
-The fact that plain parentheses fulfil two functions is not always helpful.\r
-There are often times when a grouping subpattern is required without a\r
-capturing requirement. If an opening parenthesis is followed by "?:", the\r
-subpattern does not do any capturing, and is not counted when computing the\r
-number of any subsequent capturing subpatterns. For example, if the string "the\r
-white queen" is matched against the pattern\r
-</P>\r
-<P>\r
-<PRE>\r
-  the ((?:red|white) (king|queen))\r
-</PRE>\r
-</P>\r
-<P>\r
-the captured substrings are "white queen" and "queen", and are numbered 1 and\r
-2. The maximum number of captured substrings is 99, and the maximum number of\r
-all subpatterns, both capturing and non-capturing, is 200.\r
-</P>\r
-<P>\r
-As a convenient shorthand, if any option settings are required at the start of\r
-a non-capturing subpattern, the option letters may appear between the "?" and\r
-the ":". Thus the two patterns\r
-</P>\r
-<P>\r
-<PRE>\r
-  (?i:saturday|sunday)\r
-  (?:(?i)saturday|sunday)\r
-</PRE>\r
-</P>\r
-<P>\r
-match exactly the same set of strings. Because alternative branches are tried\r
-from left to right, and options are not reset until the end of the subpattern\r
-is reached, an option setting in one branch does affect subsequent branches, so\r
-the above patterns match "SUNDAY" as well as "Saturday".\r
-</P>\r
-<LI><A NAME="SEC22" HREF="#TOC1">REPETITION</A>\r
-<P>\r
-Repetition is specified by quantifiers, which can follow any of the following\r
-items:\r
-</P>\r
-<P>\r
-<PRE>\r
-  a single character, possibly escaped\r
-  the . metacharacter\r
-  a character class\r
-  a back reference (see next section)\r
-  a parenthesized subpattern (unless it is an assertion - see below)\r
-</PRE>\r
-</P>\r
-<P>\r
-The general repetition quantifier specifies a minimum and maximum number of\r
-permitted matches, by giving the two numbers in curly brackets (braces),\r
-separated by a comma. The numbers must be less than 65536, and the first must\r
-be less than or equal to the second. For example:\r
-</P>\r
-<P>\r
-<PRE>\r
-  z{2,4}\r
-</PRE>\r
-</P>\r
-<P>\r
-matches "zz", "zzz", or "zzzz". A closing brace on its own is not a special\r
-character. If the second number is omitted, but the comma is present, there is\r
-no upper limit; if the second number and the comma are both omitted, the\r
-quantifier specifies an exact number of required matches. Thus\r
-</P>\r
-<P>\r
-<PRE>\r
-  [aeiou]{3,}\r
-</PRE>\r
-</P>\r
-<P>\r
-matches at least 3 successive vowels, but may match many more, while\r
-</P>\r
-<P>\r
-<PRE>\r
-  \d{8}\r
-</PRE>\r
-</P>\r
-<P>\r
-matches exactly 8 digits. An opening curly bracket that appears in a position\r
-where a quantifier is not allowed, or one that does not match the syntax of a\r
-quantifier, is taken as a literal character. For example, {,6} is not a\r
-quantifier, but a literal string of four characters.\r
-</P>\r
-<P>\r
-The quantifier {0} is permitted, causing the expression to behave as if the\r
-previous item and the quantifier were not present.\r
-</P>\r
-<P>\r
-For convenience (and historical compatibility) the three most common\r
-quantifiers have single-character abbreviations:\r
-</P>\r
-<P>\r
-<PRE>\r
-  *    is equivalent to {0,}\r
-  +    is equivalent to {1,}\r
-  ?    is equivalent to {0,1}\r
-</PRE>\r
-</P>\r
-<P>\r
-It is possible to construct infinite loops by following a subpattern that can\r
-match no characters with a quantifier that has no upper limit, for example:\r
-</P>\r
-<P>\r
-<PRE>\r
-  (a?)*\r
-</PRE>\r
-</P>\r
-<P>\r
-Earlier versions of Perl and PCRE used to give an error at compile time for\r
-such patterns. However, because there are cases where this can be useful, such\r
-patterns are now accepted, but if any repetition of the subpattern does in fact\r
-match no characters, the loop is forcibly broken.\r
-</P>\r
-<P>\r
-By default, the quantifiers are "greedy", that is, they match as much as\r
-possible (up to the maximum number of permitted times), without causing the\r
-rest of the pattern to fail. The classic example of where this gives problems\r
-is in trying to match comments in C programs. These appear between the\r
-sequences /* and */ and within the sequence, individual * and / characters may\r
-appear. An attempt to match C comments by applying the pattern\r
-</P>\r
-<P>\r
-<PRE>\r
-  /\*.*\*/\r
-</PRE>\r
-</P>\r
-<P>\r
-to the string\r
-</P>\r
-<P>\r
-<PRE>\r
-  /* first command */  not comment  /* second comment */\r
-</PRE>\r
-</P>\r
-<P>\r
-fails, because it matches the entire string owing to the greediness of the .*\r
-item.\r
-</P>\r
-<P>\r
-However, if a quantifier is followed by a question mark, it ceases to be\r
-greedy, and instead matches the minimum number of times possible, so the\r
-pattern\r
-</P>\r
-<P>\r
-<PRE>\r
-  /\*.*?\*/\r
-</PRE>\r
-</P>\r
-<P>\r
-does the right thing with the C comments. The meaning of the various\r
-quantifiers is not otherwise changed, just the preferred number of matches.\r
-Do not confuse this use of question mark with its use as a quantifier in its\r
-own right. Because it has two uses, it can sometimes appear doubled, as in\r
-</P>\r
-<P>\r
-<PRE>\r
-  \d??\d\r
-</PRE>\r
-</P>\r
-<P>\r
-which matches one digit by preference, but can match two if that is the only\r
-way the rest of the pattern matches.\r
-</P>\r
-<P>\r
-If the PCRE_UNGREEDY option is set (an option which is not available in Perl),\r
-the quantifiers are not greedy by default, but individual ones can be made\r
-greedy by following them with a question mark. In other words, it inverts the\r
-default behaviour.\r
-</P>\r
-<P>\r
-When a parenthesized subpattern is quantified with a minimum repeat count that\r
-is greater than 1 or with a limited maximum, more store is required for the\r
-compiled pattern, in proportion to the size of the minimum or maximum.\r
-</P>\r
-<P>\r
-If a pattern starts with .* or .{0,} and the PCRE_DOTALL option (equivalent\r
-to Perl's /s) is set, thus allowing the . to match newlines, the pattern is\r
-implicitly anchored, because whatever follows will be tried against every\r
-character position in the subject string, so there is no point in retrying the\r
-overall match at any position after the first. PCRE treats such a pattern as\r
-though it were preceded by \A. In cases where it is known that the subject\r
-string contains no newlines, it is worth setting PCRE_DOTALL when the pattern\r
-begins with .* in order to obtain this optimization, or alternatively using ^\r
-to indicate anchoring explicitly.\r
-</P>\r
-<P>\r
-When a capturing subpattern is repeated, the value captured is the substring\r
-that matched the final iteration. For example, after\r
-</P>\r
-<P>\r
-<PRE>\r
-  (tweedle[dume]{3}\s*)+\r
-</PRE>\r
-</P>\r
-<P>\r
-has matched "tweedledum tweedledee" the value of the captured substring is\r
-"tweedledee". However, if there are nested capturing subpatterns, the\r
-corresponding captured values may have been set in previous iterations. For\r
-example, after\r
-</P>\r
-<P>\r
-<PRE>\r
-  /(a|(b))+/\r
-</PRE>\r
-</P>\r
-<P>\r
-matches "aba" the value of the second captured substring is "b".\r
-</P>\r
-<LI><A NAME="SEC23" HREF="#TOC1">BACK REFERENCES</A>\r
-<P>\r
-Outside a character class, a backslash followed by a digit greater than 0 (and\r
-possibly further digits) is a back reference to a capturing subpattern earlier\r
-(i.e. to its left) in the pattern, provided there have been that many previous\r
-capturing left parentheses.\r
-</P>\r
-<P>\r
-However, if the decimal number following the backslash is less than 10, it is\r
-always taken as a back reference, and causes an error only if there are not\r
-that many capturing left parentheses in the entire pattern. In other words, the\r
-parentheses that are referenced need not be to the left of the reference for\r
-numbers less than 10. See the section entitled "Backslash" above for further\r
-details of the handling of digits following a backslash.\r
-</P>\r
-<P>\r
-A back reference matches whatever actually matched the capturing subpattern in\r
-the current subject string, rather than anything matching the subpattern\r
-itself. So the pattern\r
-</P>\r
-<P>\r
-<PRE>\r
-  (sens|respons)e and \1ibility\r
-</PRE>\r
-</P>\r
-<P>\r
-matches "sense and sensibility" and "response and responsibility", but not\r
-"sense and responsibility". If caseful matching is in force at the time of the\r
-back reference, the case of letters is relevant. For example,\r
-</P>\r
-<P>\r
-<PRE>\r
-  ((?i)rah)\s+\1\r
-</PRE>\r
-</P>\r
-<P>\r
-matches "rah rah" and "RAH RAH", but not "RAH rah", even though the original\r
-capturing subpattern is matched caselessly.\r
-</P>\r
-<P>\r
-There may be more than one back reference to the same subpattern. If a\r
-subpattern has not actually been used in a particular match, any back\r
-references to it always fail. For example, the pattern\r
-</P>\r
-<P>\r
-<PRE>\r
-  (a|(bc))\2\r
-</PRE>\r
-</P>\r
-<P>\r
-always fails if it starts to match "a" rather than "bc". Because there may be\r
-up to 99 back references, all digits following the backslash are taken\r
-as part of a potential back reference number. If the pattern continues with a\r
-digit character, some delimiter must be used to terminate the back reference.\r
-If the PCRE_EXTENDED option is set, this can be whitespace. Otherwise an empty\r
-comment can be used.\r
-</P>\r
-<P>\r
-A back reference that occurs inside the parentheses to which it refers fails\r
-when the subpattern is first used, so, for example, (a\1) never matches.\r
-However, such references can be useful inside repeated subpatterns. For\r
-example, the pattern\r
-</P>\r
-<P>\r
-<PRE>\r
-  (a|b\1)+\r
-</PRE>\r
-</P>\r
-<P>\r
-matches any number of "a"s and also "aba", "ababbaa" etc. At each iteration of\r
-the subpattern, the back reference matches the character string corresponding\r
-to the previous iteration. In order for this to work, the pattern must be such\r
-that the first iteration does not need to match the back reference. This can be\r
-done using alternation, as in the example above, or by a quantifier with a\r
-minimum of zero.\r
-</P>\r
-<LI><A NAME="SEC24" HREF="#TOC1">ASSERTIONS</A>\r
-<P>\r
-An assertion is a test on the characters following or preceding the current\r
-matching point that does not actually consume any characters. The simple\r
-assertions coded as \b, \B, \A, \Z, \z, ^ and $ are described above. More\r
-complicated assertions are coded as subpatterns. There are two kinds: those\r
-that look ahead of the current position in the subject string, and those that\r
-look behind it.\r
-</P>\r
-<P>\r
-An assertion subpattern is matched in the normal way, except that it does not\r
-cause the current matching position to be changed. Lookahead assertions start\r
-with (?= for positive assertions and (?! for negative assertions. For example,\r
-</P>\r
-<P>\r
-<PRE>\r
-  \w+(?=;)\r
-</PRE>\r
-</P>\r
-<P>\r
-matches a word followed by a semicolon, but does not include the semicolon in\r
-the match, and\r
-</P>\r
-<P>\r
-<PRE>\r
-  foo(?!bar)\r
-</PRE>\r
-</P>\r
-<P>\r
-matches any occurrence of "foo" that is not followed by "bar". Note that the\r
-apparently similar pattern\r
-</P>\r
-<P>\r
-<PRE>\r
-  (?!foo)bar\r
-</PRE>\r
-</P>\r
-<P>\r
-does not find an occurrence of "bar" that is preceded by something other than\r
-"foo"; it finds any occurrence of "bar" whatsoever, because the assertion\r
-(?!foo) is always true when the next three characters are "bar". A\r
-lookbehind assertion is needed to achieve this effect.\r
-</P>\r
-<P>\r
-Lookbehind assertions start with (?&#60;= for positive assertions and (?&#60;! for\r
-negative assertions. For example,\r
-</P>\r
-<P>\r
-<PRE>\r
-  (?&#60;!foo)bar\r
-</PRE>\r
-</P>\r
-<P>\r
-does find an occurrence of "bar" that is not preceded by "foo". The contents of\r
-a lookbehind assertion are restricted such that all the strings it matches must\r
-have a fixed length. However, if there are several alternatives, they do not\r
-all have to have the same fixed length. Thus\r
-</P>\r
-<P>\r
-<PRE>\r
-  (?&#60;=bullock|donkey)\r
-</PRE>\r
-</P>\r
-<P>\r
-is permitted, but\r
-</P>\r
-<P>\r
-<PRE>\r
-  (?&#60;!dogs?|cats?)\r
-</PRE>\r
-</P>\r
-<P>\r
-causes an error at compile time. Branches that match different length strings\r
-are permitted only at the top level of a lookbehind assertion. This is an\r
-extension compared with Perl 5.005, which requires all branches to match the\r
-same length of string. An assertion such as\r
-</P>\r
-<P>\r
-<PRE>\r
-  (?&#60;=ab(c|de))\r
-</PRE>\r
-</P>\r
-<P>\r
-is not permitted, because its single top-level branch can match two different\r
-lengths, but it is acceptable if rewritten to use two top-level branches:\r
-</P>\r
-<P>\r
-<PRE>\r
-  (?&#60;=abc|abde)\r
-</PRE>\r
-</P>\r
-<P>\r
-The implementation of lookbehind assertions is, for each alternative, to\r
-temporarily move the current position back by the fixed width and then try to\r
-match. If there are insufficient characters before the current position, the\r
-match is deemed to fail. Lookbehinds in conjunction with once-only subpatterns\r
-can be particularly useful for matching at the ends of strings; an example is\r
-given at the end of the section on once-only subpatterns.\r
-</P>\r
-<P>\r
-Several assertions (of any sort) may occur in succession. For example,\r
-</P>\r
-<P>\r
-<PRE>\r
-  (?&#60;=\d{3})(?&#60;!999)foo\r
-</PRE>\r
-</P>\r
-<P>\r
-matches "foo" preceded by three digits that are not "999". Notice that each of\r
-the assertions is applied independently at the same point in the subject\r
-string. First there is a check that the previous three characters are all\r
-digits, and then there is a check that the same three characters are not "999".\r
-This pattern does <I>not</I> match "foo" preceded by six characters, the first\r
-of which are digits and the last three of which are not "999". For example, it\r
-doesn't match "123abcfoo". A pattern to do that is\r
-</P>\r
-<P>\r
-<PRE>\r
-  (?&#60;=\d{3}...)(?&#60;!999)foo\r
-</PRE>\r
-</P>\r
-<P>\r
-This time the first assertion looks at the preceding six characters, checking\r
-that the first three are digits, and then the second assertion checks that the\r
-preceding three characters are not "999".\r
-</P>\r
-<P>\r
-Assertions can be nested in any combination. For example,\r
-</P>\r
-<P>\r
-<PRE>\r
-  (?&#60;=(?&#60;!foo)bar)baz\r
-</PRE>\r
-</P>\r
-<P>\r
-matches an occurrence of "baz" that is preceded by "bar" which in turn is not\r
-preceded by "foo", while\r
-</P>\r
-<P>\r
-<PRE>\r
-  (?&#60;=\d{3}(?!999)...)foo\r
-</PRE>\r
-</P>\r
-<P>\r
-is another pattern which matches "foo" preceded by three digits and any three\r
-characters that are not "999".\r
-</P>\r
-<P>\r
-Assertion subpatterns are not capturing subpatterns, and may not be repeated,\r
-because it makes no sense to assert the same thing several times. If any kind\r
-of assertion contains capturing subpatterns within it, these are counted for\r
-the purposes of numbering the capturing subpatterns in the whole pattern.\r
-However, substring capturing is carried out only for positive assertions,\r
-because it does not make sense for negative assertions.\r
-</P>\r
-<P>\r
-Assertions count towards the maximum of 200 parenthesized subpatterns.\r
-</P>\r
-<LI><A NAME="SEC25" HREF="#TOC1">ONCE-ONLY SUBPATTERNS</A>\r
-<P>\r
-With both maximizing and minimizing repetition, failure of what follows\r
-normally causes the repeated item to be re-evaluated to see if a different\r
-number of repeats allows the rest of the pattern to match. Sometimes it is\r
-useful to prevent this, either to change the nature of the match, or to cause\r
-it fail earlier than it otherwise might, when the author of the pattern knows\r
-there is no point in carrying on.\r
-</P>\r
-<P>\r
-Consider, for example, the pattern \d+foo when applied to the subject line\r
-</P>\r
-<P>\r
-<PRE>\r
-  123456bar\r
-</PRE>\r
-</P>\r
-<P>\r
-After matching all 6 digits and then failing to match "foo", the normal\r
-action of the matcher is to try again with only 5 digits matching the \d+\r
-item, and then with 4, and so on, before ultimately failing. Once-only\r
-subpatterns provide the means for specifying that once a portion of the pattern\r
-has matched, it is not to be re-evaluated in this way, so the matcher would\r
-give up immediately on failing to match "foo" the first time. The notation is\r
-another kind of special parenthesis, starting with (?&#62; as in this example:\r
-</P>\r
-<P>\r
-<PRE>\r
-  (?&#62;\d+)bar\r
-</PRE>\r
-</P>\r
-<P>\r
-This kind of parenthesis "locks up" the  part of the pattern it contains once\r
-it has matched, and a failure further into the pattern is prevented from\r
-backtracking into it. Backtracking past it to previous items, however, works as\r
-normal.\r
-</P>\r
-<P>\r
-An alternative description is that a subpattern of this type matches the string\r
-of characters that an identical standalone pattern would match, if anchored at\r
-the current point in the subject string.\r
-</P>\r
-<P>\r
-Once-only subpatterns are not capturing subpatterns. Simple cases such as the\r
-above example can be thought of as a maximizing repeat that must swallow\r
-everything it can. So, while both \d+ and \d+? are prepared to adjust the\r
-number of digits they match in order to make the rest of the pattern match,\r
-(?&#62;\d+) can only match an entire sequence of digits.\r
-</P>\r
-<P>\r
-This construction can of course contain arbitrarily complicated subpatterns,\r
-and it can be nested.\r
-</P>\r
-<P>\r
-Once-only subpatterns can be used in conjunction with lookbehind assertions to\r
-specify efficient matching at the end of the subject string. Consider a simple\r
-pattern such as\r
-</P>\r
-<P>\r
-<PRE>\r
-  abcd$\r
-</PRE>\r
-</P>\r
-<P>\r
-when applied to a long string which does not match. Because matching proceeds\r
-from left to right, PCRE will look for each "a" in the subject and then see if\r
-what follows matches the rest of the pattern. If the pattern is specified as\r
-</P>\r
-<P>\r
-<PRE>\r
-  ^.*abcd$\r
-</PRE>\r
-</P>\r
-<P>\r
-the initial .* matches the entire string at first, but when this fails (because\r
-there is no following "a"), it backtracks to match all but the last character,\r
-then all but the last two characters, and so on. Once again the search for "a"\r
-covers the entire string, from right to left, so we are no better off. However,\r
-if the pattern is written as\r
-</P>\r
-<P>\r
-<PRE>\r
-  ^(?&#62;.*)(?&#60;=abcd)\r
-</PRE>\r
-</P>\r
-<P>\r
-there can be no backtracking for the .* item; it can match only the entire\r
-string. The subsequent lookbehind assertion does a single test on the last four\r
-characters. If it fails, the match fails immediately. For long strings, this\r
-approach makes a significant difference to the processing time.\r
-</P>\r
-<P>\r
-When a pattern contains an unlimited repeat inside a subpattern that can itself\r
-be repeated an unlimited number of times, the use of a once-only subpattern is\r
-the only way to avoid some failing matches taking a very long time indeed.\r
-The pattern\r
-</P>\r
-<P>\r
-<PRE>\r
-  (\D+|&#60;\d+&#62;)*[!?]\r
-</PRE>\r
-</P>\r
-<P>\r
-matches an unlimited number of substrings that either consist of non-digits, or\r
-digits enclosed in &#60;&#62;, followed by either ! or ?. When it matches, it runs\r
-quickly. However, if it is applied to\r
-</P>\r
-<P>\r
-<PRE>\r
-  aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\r
-</PRE>\r
-</P>\r
-<P>\r
-it takes a long time before reporting failure. This is because the string can\r
-be divided between the two repeats in a large number of ways, and all have to\r
-be tried. (The example used [!?] rather than a single character at the end,\r
-because both PCRE and Perl have an optimization that allows for fast failure\r
-when a single character is used. They remember the last single character that\r
-is required for a match, and fail early if it is not present in the string.)\r
-If the pattern is changed to\r
-</P>\r
-<P>\r
-<PRE>\r
-  ((?&#62;\D+)|&#60;\d+&#62;)*[!?]\r
-</PRE>\r
-</P>\r
-<P>\r
-sequences of non-digits cannot be broken, and failure happens quickly.\r
-</P>\r
-<LI><A NAME="SEC26" HREF="#TOC1">CONDITIONAL SUBPATTERNS</A>\r
-<P>\r
-It is possible to cause the matching process to obey a subpattern\r
-conditionally or to choose between two alternative subpatterns, depending on\r
-the result of an assertion, or whether a previous capturing subpattern matched\r
-or not. The two possible forms of conditional subpattern are\r
-</P>\r
-<P>\r
-<PRE>\r
-  (?(condition)yes-pattern)\r
-  (?(condition)yes-pattern|no-pattern)\r
-</PRE>\r
-</P>\r
-<P>\r
-If the condition is satisfied, the yes-pattern is used; otherwise the\r
-no-pattern (if present) is used. If there are more than two alternatives in the\r
-subpattern, a compile-time error occurs.\r
-</P>\r
-<P>\r
-There are two kinds of condition. If the text between the parentheses consists\r
-of a sequence of digits, the condition is satisfied if the capturing subpattern\r
-of that number has previously matched. The number must be greater than zero.\r
-Consider the following pattern, which contains non-significant white space to\r
-make it more readable (assume the PCRE_EXTENDED option) and to divide it into\r
-three parts for ease of discussion:\r
-</P>\r
-<P>\r
-<PRE>\r
-  ( \( )?    [^()]+    (?(1) \) )\r
-</PRE>\r
-</P>\r
-<P>\r
-The first part matches an optional opening parenthesis, and if that\r
-character is present, sets it as the first captured substring. The second part\r
-matches one or more characters that are not parentheses. The third part is a\r
-conditional subpattern that tests whether the first set of parentheses matched\r
-or not. If they did, that is, if subject started with an opening parenthesis,\r
-the condition is true, and so the yes-pattern is executed and a closing\r
-parenthesis is required. Otherwise, since no-pattern is not present, the\r
-subpattern matches nothing. In other words, this pattern matches a sequence of\r
-non-parentheses, optionally enclosed in parentheses.\r
-</P>\r
-<P>\r
-If the condition is not a sequence of digits, it must be an assertion. This may\r
-be a positive or negative lookahead or lookbehind assertion. Consider this\r
-pattern, again containing non-significant white space, and with the two\r
-alternatives on the second line:\r
-</P>\r
-<P>\r
-<PRE>\r
-  (?(?=[^a-z]*[a-z])\r
-  \d{2}-[a-z]{3}-\d{2}  |  \d{2}-\d{2}-\d{2} )\r
-</PRE>\r
-</P>\r
-<P>\r
-The condition is a positive lookahead assertion that matches an optional\r
-sequence of non-letters followed by a letter. In other words, it tests for the\r
-presence of at least one letter in the subject. If a letter is found, the\r
-subject is matched against the first alternative; otherwise it is matched\r
-against the second. This pattern matches strings in one of the two forms\r
-dd-aaa-dd or dd-dd-dd, where aaa are letters and dd are digits.\r
-</P>\r
-<LI><A NAME="SEC27" HREF="#TOC1">COMMENTS</A>\r
-<P>\r
-The sequence (?# marks the start of a comment which continues up to the next\r
-closing parenthesis. Nested parentheses are not permitted. The characters\r
-that make up a comment play no part in the pattern matching at all.\r
-</P>\r
-<P>\r
-If the PCRE_EXTENDED option is set, an unescaped # character outside a\r
-character class introduces a comment that continues up to the next newline\r
-character in the pattern.\r
-</P>\r
-<LI><A NAME="SEC28" HREF="#TOC1">RECURSIVE PATTERNS</A>\r
-<P>\r
-Consider the problem of matching a string in parentheses, allowing for\r
-unlimited nested parentheses. Without the use of recursion, the best that can\r
-be done is to use a pattern that matches up to some fixed depth of nesting. It\r
-is not possible to handle an arbitrary nesting depth. Perl 5.6 has provided an\r
-experimental facility that allows regular expressions to recurse (amongst other\r
-things). It does this by interpolating Perl code in the expression at run time,\r
-and the code can refer to the expression itself. A Perl pattern to solve the\r
-parentheses problem can be created like this:\r
-</P>\r
-<P>\r
-<PRE>\r
-  $re = qr{\( (?: (?&#62;[^()]+) | (?p{$re}) )* \)}x;\r
-</PRE>\r
-</P>\r
-<P>\r
-The (?p{...}) item interpolates Perl code at run time, and in this case refers\r
-recursively to the pattern in which it appears. Obviously, PCRE cannot support\r
-the interpolation of Perl code. Instead, the special item (?R) is provided for\r
-the specific case of recursion. This PCRE pattern solves the parentheses\r
-problem (assume the PCRE_EXTENDED option is set so that white space is\r
-ignored):\r
-</P>\r
-<P>\r
-<PRE>\r
-  \( ( (?&#62;[^()]+) | (?R) )* \)\r
-</PRE>\r
-</P>\r
-<P>\r
-First it matches an opening parenthesis. Then it matches any number of\r
-substrings which can either be a sequence of non-parentheses, or a recursive\r
-match of the pattern itself (i.e. a correctly parenthesized substring). Finally\r
-there is a closing parenthesis.\r
-</P>\r
-<P>\r
-This particular example pattern contains nested unlimited repeats, and so the\r
-use of a once-only subpattern for matching strings of non-parentheses is\r
-important when applying the pattern to strings that do not match. For example,\r
-when it is applied to\r
-</P>\r
-<P>\r
-<PRE>\r
-  (aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa()\r
-</PRE>\r
-</P>\r
-<P>\r
-it yields "no match" quickly. However, if a once-only subpattern is not used,\r
-the match runs for a very long time indeed because there are so many different\r
-ways the + and * repeats can carve up the subject, and all have to be tested\r
-before failure can be reported.\r
-</P>\r
-<P>\r
-The values set for any capturing subpatterns are those from the outermost level\r
-of the recursion at which the subpattern value is set. If the pattern above is\r
-matched against\r
-</P>\r
-<P>\r
-<PRE>\r
-  (ab(cd)ef)\r
-</PRE>\r
-</P>\r
-<P>\r
-the value for the capturing parentheses is "ef", which is the last value taken\r
-on at the top level. If additional parentheses are added, giving\r
-</P>\r
-<P>\r
-<PRE>\r
-  \( ( ( (?&#62;[^()]+) | (?R) )* ) \)\r
-     ^                        ^\r
-     ^                        ^\r
-</PRE>\r
-the string they capture is "ab(cd)ef", the contents of the top level\r
-parentheses. If there are more than 15 capturing parentheses in a pattern, PCRE\r
-has to obtain extra memory to store data during a recursion, which it does by\r
-using <B>pcre_malloc</B>, freeing it via <B>pcre_free</B> afterwards. If no\r
-memory can be obtained, it saves data for the first 15 capturing parentheses\r
-only, as there is no way to give an out-of-memory error from within a\r
-recursion.\r
-</P>\r
-<LI><A NAME="SEC29" HREF="#TOC1">PERFORMANCE</A>\r
-<P>\r
-Certain items that may appear in patterns are more efficient than others. It is\r
-more efficient to use a character class like [aeiou] than a set of alternatives\r
-such as (a|e|i|o|u). In general, the simplest construction that provides the\r
-required behaviour is usually the most efficient. Jeffrey Friedl's book\r
-contains a lot of discussion about optimizing regular expressions for efficient\r
-performance.\r
-</P>\r
-<P>\r
-When a pattern begins with .* and the PCRE_DOTALL option is set, the pattern is\r
-implicitly anchored by PCRE, since it can match only at the start of a subject\r
-string. However, if PCRE_DOTALL is not set, PCRE cannot make this optimization,\r
-because the . metacharacter does not then match a newline, and if the subject\r
-string contains newlines, the pattern may match from the character immediately\r
-following one of them instead of from the very start. For example, the pattern\r
-</P>\r
-<P>\r
-<PRE>\r
-  (.*) second\r
-</PRE>\r
-</P>\r
-<P>\r
-matches the subject "first\nand second" (where \n stands for a newline\r
-character) with the first captured substring being "and". In order to do this,\r
-PCRE has to retry the match starting after every newline in the subject.\r
-</P>\r
-<P>\r
-If you are using such a pattern with subject strings that do not contain\r
-newlines, the best performance is obtained by setting PCRE_DOTALL, or starting\r
-the pattern with ^.* to indicate explicit anchoring. That saves PCRE from\r
-having to scan along the subject looking for a newline to restart at.\r
-</P>\r
-<P>\r
-Beware of patterns that contain nested indefinite repeats. These can take a\r
-long time to run when applied to a string that does not match. Consider the\r
-pattern fragment\r
-</P>\r
-<P>\r
-<PRE>\r
-  (a+)*\r
-</PRE>\r
-</P>\r
-<P>\r
-This can match "aaaa" in 33 different ways, and this number increases very\r
-rapidly as the string gets longer. (The * repeat can match 0, 1, 2, 3, or 4\r
-times, and for each of those cases other than 0, the + repeats can match\r
-different numbers of times.) When the remainder of the pattern is such that the\r
-entire match is going to fail, PCRE has in principle to try every possible\r
-variation, and this can take an extremely long time.\r
-</P>\r
-<P>\r
-An optimization catches some of the more simple cases such as\r
-</P>\r
-<P>\r
-<PRE>\r
-  (a+)*b\r
-</PRE>\r
-</P>\r
-<P>\r
-where a literal character follows. Before embarking on the standard matching\r
-procedure, PCRE checks that there is a "b" later in the subject string, and if\r
-there is not, it fails the match immediately. However, when there is no\r
-following literal this optimization cannot be used. You can see the difference\r
-by comparing the behaviour of\r
-</P>\r
-<P>\r
-<PRE>\r
-  (a+)*\d\r
-</PRE>\r
-</P>\r
-<P>\r
-with the pattern above. The former gives a failure almost instantly when\r
-applied to a whole line of "a" characters, whereas the latter takes an\r
-appreciable time with strings longer than about 20 characters.\r
-</P>\r
-<LI><A NAME="SEC30" HREF="#TOC1">UTF-8 SUPPORT</A>\r
-<P>\r
-Starting at release 3.3, PCRE has some support for character strings encoded\r
-in the UTF-8 format. This is incomplete, and is regarded as experimental. In\r
-order to use it, you must configure PCRE to include UTF-8 support in the code,\r
-and, in addition, you must call <B>pcre_compile()</B> with the PCRE_UTF8 option\r
-flag. When you do this, both the pattern and any subject strings that are\r
-matched against it are treated as UTF-8 strings instead of just strings of\r
-bytes, but only in the cases that are mentioned below.\r
-</P>\r
-<P>\r
-If you compile PCRE with UTF-8 support, but do not use it at run time, the\r
-library will be a bit bigger, but the additional run time overhead is limited\r
-to testing the PCRE_UTF8 flag in several places, so should not be very large.\r
-</P>\r
-<P>\r
-PCRE assumes that the strings it is given contain valid UTF-8 codes. It does\r
-not diagnose invalid UTF-8 strings. If you pass invalid UTF-8 strings to PCRE,\r
-the results are undefined.\r
-</P>\r
-<P>\r
-Running with PCRE_UTF8 set causes these changes in the way PCRE works:\r
-</P>\r
-<P>\r
-1. In a pattern, the escape sequence \x{...}, where the contents of the braces\r
-is a string of hexadecimal digits, is interpreted as a UTF-8 character whose\r
-code number is the given hexadecimal number, for example: \x{1234}. This\r
-inserts from one to six literal bytes into the pattern, using the UTF-8\r
-encoding. If a non-hexadecimal digit appears between the braces, the item is\r
-not recognized.\r
-</P>\r
-<P>\r
-2. The original hexadecimal escape sequence, \xhh, generates a two-byte UTF-8\r
-character if its value is greater than 127.\r
-</P>\r
-<P>\r
-3. Repeat quantifiers are NOT correctly handled if they follow a multibyte\r
-character. For example, \x{100}* and \xc3+ do not work. If you want to\r
-repeat such characters, you must enclose them in non-capturing parentheses,\r
-for example (?:\x{100}), at present.\r
-</P>\r
-<P>\r
-4. The dot metacharacter matches one UTF-8 character instead of a single byte.\r
-</P>\r
-<P>\r
-5. Unlike literal UTF-8 characters, the dot metacharacter followed by a\r
-repeat quantifier does operate correctly on UTF-8 characters instead of\r
-single bytes.\r
-</P>\r
-<P>\r
-4. Although the \x{...} escape is permitted in a character class, characters\r
-whose values are greater than 255 cannot be included in a class.\r
-</P>\r
-<P>\r
-5. A class is matched against a UTF-8 character instead of just a single byte,\r
-but it can match only characters whose values are less than 256. Characters\r
-with greater values always fail to match a class.\r
-</P>\r
-<P>\r
-6. Repeated classes work correctly on multiple characters.\r
-</P>\r
-<P>\r
-7. Classes containing just a single character whose value is greater than 127\r
-(but less than 256), for example, [\x80] or [^\x{93}], do not work because\r
-these are optimized into single byte matches. In the first case, of course,\r
-the class brackets are just redundant.\r
-</P>\r
-<P>\r
-8. Lookbehind assertions move backwards in the subject by a fixed number of\r
-characters instead of a fixed number of bytes. Simple cases have been tested\r
-to work correctly, but there may be hidden gotchas herein.\r
-</P>\r
-<P>\r
-9. The character types such as \d and \w do not work correctly with UTF-8\r
-characters. They continue to test a single byte.\r
-</P>\r
-<P>\r
-10. Anything not explicitly mentioned here continues to work in bytes rather\r
-than in characters.\r
-</P>\r
-<P>\r
-The following UTF-8 features of Perl 5.6 are not implemented:\r
-</P>\r
-<P>\r
-1. The escape sequence \C to match a single byte.\r
-</P>\r
-<P>\r
-2. The use of Unicode tables and properties and escapes \p, \P, and \X.\r
-</P>\r
-<LI><A NAME="SEC31" HREF="#TOC1">AUTHOR</A>\r
-<P>\r
-Philip Hazel &#60;ph10@cam.ac.uk&#62;\r
-<BR>\r
-University Computing Service,\r
-<BR>\r
-New Museums Site,\r
-<BR>\r
-Cambridge CB2 3QG, England.\r
-<BR>\r
-Phone: +44 1223 334714\r
-</P>\r
-<P>\r
-Last updated: 28 August 2000,\r
-<BR>\r
-<PRE>\r
-  the 250th anniversary of the death of J.S. Bach.\r
-<BR>\r
-</PRE>\r
-Copyright (c) 1997-2000 University of Cambridge.\r