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

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

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

revision 345 by ph10, Mon Apr 28 15:10:02 2008 UTC revision 454 by ph10, Tue Sep 22 09:42:11 2009 UTC
# Line 164  Applications can use these to include su Line 164  Applications can use these to include su
164  The functions <b>pcre_compile()</b>, <b>pcre_compile2()</b>, <b>pcre_study()</b>,  The functions <b>pcre_compile()</b>, <b>pcre_compile2()</b>, <b>pcre_study()</b>,
165  and <b>pcre_exec()</b> are used for compiling and matching regular expressions  and <b>pcre_exec()</b> are used for compiling and matching regular expressions
166  in a Perl-compatible manner. A sample program that demonstrates the simplest  in a Perl-compatible manner. A sample program that demonstrates the simplest
167  way of using them is provided in the file called <i>pcredemo.c</i> in the source  way of using them is provided in the file called <i>pcredemo.c</i> in the PCRE
168  distribution. The  source distribution. A listing of this program is given in the
169    <a href="pcredemo.html"><b>pcredemo</b></a>
170    documentation, and the
171  <a href="pcresample.html"><b>pcresample</b></a>  <a href="pcresample.html"><b>pcresample</b></a>
172  documentation describes how to compile and run it.  documentation describes how to compile and run it.
173  </P>  </P>
# Line 173  documentation describes how to compile a Line 175  documentation describes how to compile a
175  A second matching function, <b>pcre_dfa_exec()</b>, which is not  A second matching function, <b>pcre_dfa_exec()</b>, which is not
176  Perl-compatible, is also provided. This uses a different algorithm for the  Perl-compatible, is also provided. This uses a different algorithm for the
177  matching. The alternative algorithm finds all possible matches (at a given  matching. The alternative algorithm finds all possible matches (at a given
178  point in the subject), and scans the subject just once. However, this algorithm  point in the subject), and scans the subject just once (unless there are
179  does not return captured substrings. A description of the two matching  lookbehind assertions). However, this algorithm does not return captured
180  algorithms and their advantages and disadvantages is given in the  substrings. A description of the two matching algorithms and their advantages
181    and disadvantages is given in the
182  <a href="pcrematching.html"><b>pcrematching</b></a>  <a href="pcrematching.html"><b>pcrematching</b></a>
183  documentation.  documentation.
184  </P>  </P>
# Line 333  properties is available; otherwise it is Line 336  properties is available; otherwise it is
336  </pre>  </pre>
337  The output is an integer whose value specifies the default character sequence  The output is an integer whose value specifies the default character sequence
338  that is recognized as meaning "newline". The four values that are supported  that is recognized as meaning "newline". The four values that are supported
339  are: 10 for LF, 13 for CR, 3338 for CRLF, -2 for ANYCRLF, and -1 for ANY. The  are: 10 for LF, 13 for CR, 3338 for CRLF, -2 for ANYCRLF, and -1 for ANY.
340  default should normally be the standard sequence for your operating system.  Though they are derived from ASCII, the same values are returned in EBCDIC
341    environments. The default should normally correspond to the standard sequence
342    for your operating system.
343  <pre>  <pre>
344    PCRE_CONFIG_BSR    PCRE_CONFIG_BSR
345  </pre>  </pre>
# Line 361  documentation. Line 366  documentation.
366  <pre>  <pre>
367    PCRE_CONFIG_MATCH_LIMIT    PCRE_CONFIG_MATCH_LIMIT
368  </pre>  </pre>
369  The output is an integer that gives the default limit for the number of  The output is a long integer that gives the default limit for the number of
370  internal matching function calls in a <b>pcre_exec()</b> execution. Further  internal matching function calls in a <b>pcre_exec()</b> execution. Further
371  details are given with <b>pcre_exec()</b> below.  details are given with <b>pcre_exec()</b> below.
372  <pre>  <pre>
373    PCRE_CONFIG_MATCH_LIMIT_RECURSION    PCRE_CONFIG_MATCH_LIMIT_RECURSION
374  </pre>  </pre>
375  The output is an integer that gives the default limit for the depth of  The output is a long integer that gives the default limit for the depth of
376  recursion when calling the internal matching function in a <b>pcre_exec()</b>  recursion when calling the internal matching function in a <b>pcre_exec()</b>
377  execution. Further details are given with <b>pcre_exec()</b> below.  execution. Further details are given with <b>pcre_exec()</b> below.
378  <pre>  <pre>
# Line 414  argument, which is an address (see below Line 419  argument, which is an address (see below
419  <P>  <P>
420  The <i>options</i> argument contains various bit settings that affect the  The <i>options</i> argument contains various bit settings that affect the
421  compilation. It should be zero if no options are required. The available  compilation. It should be zero if no options are required. The available
422  options are described below. Some of them, in particular, those that are  options are described below. Some of them (in particular, those that are
423  compatible with Perl, can also be set and unset from within the pattern (see  compatible with Perl, but also some others) can also be set and unset from
424  the detailed description in the  within the pattern (see the detailed description in the
425  <a href="pcrepattern.html"><b>pcrepattern</b></a>  <a href="pcrepattern.html"><b>pcrepattern</b></a>
426  documentation). For these options, the contents of the <i>options</i> argument  documentation). For those options that can be different in different parts of
427  specifies their initial settings at the start of compilation and execution. The  the pattern, the contents of the <i>options</i> argument specifies their initial
428  PCRE_ANCHORED and PCRE_NEWLINE_<i>xxx</i> options can be set at the time of  settings at the start of compilation and execution. The PCRE_ANCHORED and
429  matching as well as at compile time.  PCRE_NEWLINE_<i>xxx</i> options can be set at the time of matching as well as at
430    compile time.
431  </P>  </P>
432  <P>  <P>
433  If <i>errptr</i> is NULL, <b>pcre_compile()</b> returns NULL immediately.  If <i>errptr</i> is NULL, <b>pcre_compile()</b> returns NULL immediately.
434  Otherwise, if compilation of a pattern fails, <b>pcre_compile()</b> returns  Otherwise, if compilation of a pattern fails, <b>pcre_compile()</b> returns
435  NULL, and sets the variable pointed to by <i>errptr</i> to point to a textual  NULL, and sets the variable pointed to by <i>errptr</i> to point to a textual
436  error message. This is a static string that is part of the library. You must  error message. This is a static string that is part of the library. You must
437  not try to free it. The offset from the start of the pattern to the character  not try to free it. The byte offset from the start of the pattern to the
438  where the error was discovered is placed in the variable pointed to by  character that was being processes when the error was discovered is placed in
439  <i>erroffset</i>, which must not be NULL. If it is, an immediate error is given.  the variable pointed to by <i>erroffset</i>, which must not be NULL. If it is,
440    an immediate error is given. Some errors are not detected until checks are
441    carried out when the whole pattern has been scanned; in this case the offset is
442    set to the end of the pattern.
443  </P>  </P>
444  <P>  <P>
445  If <b>pcre_compile2()</b> is used instead of <b>pcre_compile()</b>, and the  If <b>pcre_compile2()</b> is used instead of <b>pcre_compile()</b>, and the
# Line 1012  different for each compiled pattern. Line 1021  different for each compiled pattern.
1021  <pre>  <pre>
1022    PCRE_INFO_OKPARTIAL    PCRE_INFO_OKPARTIAL
1023  </pre>  </pre>
1024  Return 1 if the pattern can be used for partial matching, otherwise 0. The  Return 1 if the pattern can be used for partial matching with
1025  fourth argument should point to an <b>int</b> variable. The  <b>pcre_exec()</b>, otherwise 0. The fourth argument should point to an
1026    <b>int</b> variable. From release 8.00, this always returns 1, because the
1027    restrictions that previously applied to partial matching have been lifted. The
1028  <a href="pcrepartial.html"><b>pcrepartial</b></a>  <a href="pcrepartial.html"><b>pcrepartial</b></a>
1029  documentation lists the restrictions that apply to patterns when partial  documentation gives details of partial matching.
 matching is used.  
1030  <pre>  <pre>
1031    PCRE_INFO_OPTIONS    PCRE_INFO_OPTIONS
1032  </pre>  </pre>
# Line 1218  PCRE_EXTRA_MATCH_LIMIT_RECURSION is set Line 1228  PCRE_EXTRA_MATCH_LIMIT_RECURSION is set
1228  is exceeded, <b>pcre_exec()</b> returns PCRE_ERROR_RECURSIONLIMIT.  is exceeded, <b>pcre_exec()</b> returns PCRE_ERROR_RECURSIONLIMIT.
1229  </P>  </P>
1230  <P>  <P>
1231  The <i>pcre_callout</i> field is used in conjunction with the "callout" feature,  The <i>callout_data</i> field is used in conjunction with the "callout" feature,
1232  which is described in the  and is described in the
1233  <a href="pcrecallout.html"><b>pcrecallout</b></a>  <a href="pcrecallout.html"><b>pcrecallout</b></a>
1234  documentation.  documentation.
1235  </P>  </P>
# Line 1242  Option bits for <b>pcre_exec()</b> Line 1252  Option bits for <b>pcre_exec()</b>
1252  <P>  <P>
1253  The unused bits of the <i>options</i> argument for <b>pcre_exec()</b> must be  The unused bits of the <i>options</i> argument for <b>pcre_exec()</b> must be
1254  zero. The only bits that may be set are PCRE_ANCHORED, PCRE_NEWLINE_<i>xxx</i>,  zero. The only bits that may be set are PCRE_ANCHORED, PCRE_NEWLINE_<i>xxx</i>,
1255  PCRE_NOTBOL, PCRE_NOTEOL, PCRE_NOTEMPTY, PCRE_NO_UTF8_CHECK and PCRE_PARTIAL.  PCRE_NOTBOL, PCRE_NOTEOL, PCRE_NOTEMPTY, PCRE_NOTEMPTY_ATSTART,
1256    PCRE_NO_START_OPTIMIZE, PCRE_NO_UTF8_CHECK, PCRE_PARTIAL_SOFT, and
1257    PCRE_PARTIAL_HARD.
1258  <pre>  <pre>
1259    PCRE_ANCHORED    PCRE_ANCHORED
1260  </pre>  </pre>
# Line 1321  match the empty string, the entire match Line 1333  match the empty string, the entire match
1333  <pre>  <pre>
1334    a?b?    a?b?
1335  </pre>  </pre>
1336  is applied to a string not beginning with "a" or "b", it matches the empty  is applied to a string not beginning with "a" or "b", it matches an empty
1337  string at the start of the subject. With PCRE_NOTEMPTY set, this match is not  string at the start of the subject. With PCRE_NOTEMPTY set, this match is not
1338  valid, so PCRE searches further into the string for occurrences of "a" or "b".  valid, so PCRE searches further into the string for occurrences of "a" or "b".
1339    <pre>
1340      PCRE_NOTEMPTY_ATSTART
1341    </pre>
1342    This is like PCRE_NOTEMPTY, except that an empty string match that is not at
1343    the start of the subject is permitted. If the pattern is anchored, such a match
1344    can occur only if the pattern contains \K.
1345  </P>  </P>
1346  <P>  <P>
1347  Perl has no direct equivalent of PCRE_NOTEMPTY, but it does make a special case  Perl has no direct equivalent of PCRE_NOTEMPTY or PCRE_NOTEMPTY_ATSTART, but it
1348  of a pattern match of the empty string within its <b>split()</b> function, and  does make a special case of a pattern match of the empty string within its
1349  when using the /g modifier. It is possible to emulate Perl's behaviour after  <b>split()</b> function, and when using the /g modifier. It is possible to
1350  matching a null string by first trying the match again at the same offset with  emulate Perl's behaviour after matching a null string by first trying the match
1351  PCRE_NOTEMPTY and PCRE_ANCHORED, and then if that fails by advancing the  again at the same offset with PCRE_NOTEMPTY_ATSTART and PCRE_ANCHORED, and then
1352  starting offset (see below) and trying an ordinary match again. There is some  if that fails, by advancing the starting offset (see below) and trying an
1353  code that demonstrates how to do this in the <i>pcredemo.c</i> sample program.  ordinary match again. There is some code that demonstrates how to do this in
1354    the
1355    <a href="pcredemo.html"><b>pcredemo</b></a>
1356    sample program.
1357    <pre>
1358      PCRE_NO_START_OPTIMIZE
1359    </pre>
1360    There are a number of optimizations that <b>pcre_exec()</b> uses at the start of
1361    a match, in order to speed up the process. For example, if it is known that a
1362    match must start with a specific character, it searches the subject for that
1363    character, and fails immediately if it cannot find it, without actually running
1364    the main matching function. When callouts are in use, these optimizations can
1365    cause them to be skipped. This option disables the "start-up" optimizations,
1366    causing performance to suffer, but ensuring that the callouts do occur.
1367  <pre>  <pre>
1368    PCRE_NO_UTF8_CHECK    PCRE_NO_UTF8_CHECK
1369  </pre>  </pre>
# Line 1359  PCRE_NO_UTF8_CHECK is set, the effect of Line 1390  PCRE_NO_UTF8_CHECK is set, the effect of
1390  subject, or a value of <i>startoffset</i> that does not point to the start of a  subject, or a value of <i>startoffset</i> that does not point to the start of a
1391  UTF-8 character, is undefined. Your program may crash.  UTF-8 character, is undefined. Your program may crash.
1392  <pre>  <pre>
1393    PCRE_PARTIAL    PCRE_PARTIAL_HARD
1394      PCRE_PARTIAL_SOFT
1395  </pre>  </pre>
1396  This option turns on the partial matching feature. If the subject string fails  These options turn on the partial matching feature. For backwards
1397  to match the pattern, but at some point during the matching process the end of  compatibility, PCRE_PARTIAL is a synonym for PCRE_PARTIAL_SOFT. A partial match
1398  the subject was reached (that is, the subject partially matches the pattern and  occurs if the end of the subject string is reached successfully, but there are
1399  the failure to match occurred only because there were not enough subject  not enough subject characters to complete the match. If this happens when
1400  characters), <b>pcre_exec()</b> returns PCRE_ERROR_PARTIAL instead of  PCRE_PARTIAL_HARD is set, <b>pcre_exec()</b> immediately returns
1401  PCRE_ERROR_NOMATCH. When PCRE_PARTIAL is used, there are restrictions on what  PCRE_ERROR_PARTIAL. Otherwise, if PCRE_PARTIAL_SOFT is set, matching continues
1402  may appear in the pattern. These are discussed in the  by testing any other alternatives. Only if they all fail is PCRE_ERROR_PARTIAL
1403    returned (instead of PCRE_ERROR_NOMATCH). The portion of the string that
1404    was inspected when the partial match was found is set as the first matching
1405    string. There is a more detailed discussion in the
1406  <a href="pcrepartial.html"><b>pcrepartial</b></a>  <a href="pcrepartial.html"><b>pcrepartial</b></a>
1407  documentation.  documentation.
1408  </P>  </P>
# Line 1376  The string to be matched by <b>pcre_exec Line 1411  The string to be matched by <b>pcre_exec
1411  </b><br>  </b><br>
1412  <P>  <P>
1413  The subject string is passed to <b>pcre_exec()</b> as a pointer in  The subject string is passed to <b>pcre_exec()</b> as a pointer in
1414  <i>subject</i>, a length in <i>length</i>, and a starting byte offset in  <i>subject</i>, a length (in bytes) in <i>length</i>, and a starting byte offset
1415  <i>startoffset</i>. In UTF-8 mode, the byte offset must point to the start of a  in <i>startoffset</i>. In UTF-8 mode, the byte offset must point to the start of
1416  UTF-8 character. Unlike the pattern string, the subject may contain binary zero  a UTF-8 character. Unlike the pattern string, the subject may contain binary
1417  bytes. When the starting offset is zero, the search for a match starts at the  zero bytes. When the starting offset is zero, the search for a match starts at
1418  beginning of the subject, and this is by far the most common case.  the beginning of the subject, and this is by far the most common case.
1419  </P>  </P>
1420  <P>  <P>
1421  A non-zero starting offset is useful when searching for another match in the  A non-zero starting offset is useful when searching for another match in the
# Line 1418  a fragment of a pattern that picks out a Line 1453  a fragment of a pattern that picks out a
1453  kinds of parenthesized subpattern that do not cause substrings to be captured.  kinds of parenthesized subpattern that do not cause substrings to be captured.
1454  </P>  </P>
1455  <P>  <P>
1456  Captured substrings are returned to the caller via a vector of integer offsets  Captured substrings are returned to the caller via a vector of integers whose
1457  whose address is passed in <i>ovector</i>. The number of elements in the vector  address is passed in <i>ovector</i>. The number of elements in the vector is
1458  is passed in <i>ovecsize</i>, which must be a non-negative number. <b>Note</b>:  passed in <i>ovecsize</i>, which must be a non-negative number. <b>Note</b>: this
1459  this argument is NOT the size of <i>ovector</i> in bytes.  argument is NOT the size of <i>ovector</i> in bytes.
1460  </P>  </P>
1461  <P>  <P>
1462  The first two-thirds of the vector is used to pass back captured substrings,  The first two-thirds of the vector is used to pass back captured substrings,
1463  each substring using a pair of integers. The remaining third of the vector is  each substring using a pair of integers. The remaining third of the vector is
1464  used as workspace by <b>pcre_exec()</b> while matching capturing subpatterns,  used as workspace by <b>pcre_exec()</b> while matching capturing subpatterns,
1465  and is not available for passing back information. The length passed in  and is not available for passing back information. The number passed in
1466  <i>ovecsize</i> should always be a multiple of three. If it is not, it is  <i>ovecsize</i> should always be a multiple of three. If it is not, it is
1467  rounded down.  rounded down.
1468  </P>  </P>
1469  <P>  <P>
1470  When a match is successful, information about captured substrings is returned  When a match is successful, information about captured substrings is returned
1471  in pairs of integers, starting at the beginning of <i>ovector</i>, and  in pairs of integers, starting at the beginning of <i>ovector</i>, and
1472  continuing up to two-thirds of its length at the most. The first element of a  continuing up to two-thirds of its length at the most. The first element of
1473  pair is set to the offset of the first character in a substring, and the second  each pair is set to the byte offset of the first character in a substring, and
1474  is set to the offset of the first character after the end of a substring. The  the second is set to the byte offset of the first character after the end of a
1475  first pair, <i>ovector[0]</i> and <i>ovector[1]</i>, identify the portion of the  substring. <b>Note</b>: these values are always byte offsets, even in UTF-8
1476  subject string matched by the entire pattern. The next pair is used for the  mode. They are not character counts.
1477  first capturing subpattern, and so on. The value returned by <b>pcre_exec()</b>  </P>
1478  is one more than the highest numbered pair that has been set. For example, if  <P>
1479  two substrings have been captured, the returned value is 3. If there are no  The first pair of integers, <i>ovector[0]</i> and <i>ovector[1]</i>, identify the
1480  capturing subpatterns, the return value from a successful match is 1,  portion of the subject string matched by the entire pattern. The next pair is
1481  indicating that just the first pair of offsets has been set.  used for the first capturing subpattern, and so on. The value returned by
1482    <b>pcre_exec()</b> is one more than the highest numbered pair that has been set.
1483    For example, if two substrings have been captured, the returned value is 3. If
1484    there are no capturing subpatterns, the return value from a successful match is
1485    1, indicating that just the first pair of offsets has been set.
1486  </P>  </P>
1487  <P>  <P>
1488  If a capturing subpattern is matched repeatedly, it is the last portion of the  If a capturing subpattern is matched repeatedly, it is the last portion of the
# Line 1452  string that it matched that is returned. Line 1491  string that it matched that is returned.
1491  <P>  <P>
1492  If the vector is too small to hold all the captured substring offsets, it is  If the vector is too small to hold all the captured substring offsets, it is
1493  used as far as possible (up to two-thirds of its length), and the function  used as far as possible (up to two-thirds of its length), and the function
1494  returns a value of zero. In particular, if the substring offsets are not of  returns a value of zero. If the substring offsets are not of interest,
1495  interest, <b>pcre_exec()</b> may be called with <i>ovector</i> passed as NULL and  <b>pcre_exec()</b> may be called with <i>ovector</i> passed as NULL and
1496  <i>ovecsize</i> as zero. However, if the pattern contains back references and  <i>ovecsize</i> as zero. However, if the pattern contains back references and
1497  the <i>ovector</i> is not big enough to remember the related substrings, PCRE  the <i>ovector</i> is not big enough to remember the related substrings, PCRE
1498  has to get additional memory for use during matching. Thus it is usually  has to get additional memory for use during matching. Thus it is usually
# Line 1564  documentation for details of partial mat Line 1603  documentation for details of partial mat
1603  <pre>  <pre>
1604    PCRE_ERROR_BADPARTIAL     (-13)    PCRE_ERROR_BADPARTIAL     (-13)
1605  </pre>  </pre>
1606  The PCRE_PARTIAL option was used with a compiled pattern containing items that  This code is no longer in use. It was formerly returned when the PCRE_PARTIAL
1607  are not supported for partial matching. See the  option was used with a compiled pattern containing items that were not
1608  <a href="pcrepartial.html"><b>pcrepartial</b></a>  supported for partial matching. From release 8.00 onwards, there are no
1609  documentation for details of partial matching.  restrictions on partial matching.
1610  <pre>  <pre>
1611    PCRE_ERROR_INTERNAL       (-14)    PCRE_ERROR_INTERNAL       (-14)
1612  </pre>  </pre>
# Line 1739  then call <b>pcre_copy_substring()</b> o Line 1778  then call <b>pcre_copy_substring()</b> o
1778  appropriate. <b>NOTE:</b> If PCRE_DUPNAMES is set and there are duplicate names,  appropriate. <b>NOTE:</b> If PCRE_DUPNAMES is set and there are duplicate names,
1779  the behaviour may not be what you want (see the next section).  the behaviour may not be what you want (see the next section).
1780  </P>  </P>
1781    <P>
1782    <b>Warning:</b> If the pattern uses the "(?|" feature to set up multiple
1783    subpatterns with the same number, you cannot use names to distinguish them,
1784    because names are not included in the compiled code. The matching process uses
1785    only numbers.
1786    </P>
1787  <br><a name="SEC17" href="#TOC1">DUPLICATE SUBPATTERN NAMES</a><br>  <br><a name="SEC17" href="#TOC1">DUPLICATE SUBPATTERN NAMES</a><br>
1788  <P>  <P>
1789  <b>int pcre_get_stringtable_entries(const pcre *<i>code</i>,</b>  <b>int pcre_get_stringtable_entries(const pcre *<i>code</i>,</b>
# Line 1804  a compiled pattern, using a matching alg Line 1849  a compiled pattern, using a matching alg
1849  just once, and does not backtrack. This has different characteristics to the  just once, and does not backtrack. This has different characteristics to the
1850  normal algorithm, and is not compatible with Perl. Some of the features of PCRE  normal algorithm, and is not compatible with Perl. Some of the features of PCRE
1851  patterns are not supported. Nevertheless, there are times when this kind of  patterns are not supported. Nevertheless, there are times when this kind of
1852  matching can be useful. For a discussion of the two matching algorithms, see  matching can be useful. For a discussion of the two matching algorithms, and a
1853  the  list of features that <b>pcre_dfa_exec()</b> does not support, see the
1854  <a href="pcrematching.html"><b>pcrematching</b></a>  <a href="pcrematching.html"><b>pcrematching</b></a>
1855  documentation.  documentation.
1856  </P>  </P>
# Line 1847  Option bits for <b>pcre_dfa_exec()</b> Line 1892  Option bits for <b>pcre_dfa_exec()</b>
1892  <P>  <P>
1893  The unused bits of the <i>options</i> argument for <b>pcre_dfa_exec()</b> must be  The unused bits of the <i>options</i> argument for <b>pcre_dfa_exec()</b> must be
1894  zero. The only bits that may be set are PCRE_ANCHORED, PCRE_NEWLINE_<i>xxx</i>,  zero. The only bits that may be set are PCRE_ANCHORED, PCRE_NEWLINE_<i>xxx</i>,
1895  PCRE_NOTBOL, PCRE_NOTEOL, PCRE_NOTEMPTY, PCRE_NO_UTF8_CHECK, PCRE_PARTIAL,  PCRE_NOTBOL, PCRE_NOTEOL, PCRE_NOTEMPTY, PCRE_NOTEMPTY_ATSTART,
1896  PCRE_DFA_SHORTEST, and PCRE_DFA_RESTART. All but the last three of these are  PCRE_NO_UTF8_CHECK, PCRE_PARTIAL_HARD, PCRE_PARTIAL_SOFT, PCRE_DFA_SHORTEST,
1897  the same as for <b>pcre_exec()</b>, so their description is not repeated here.  and PCRE_DFA_RESTART. All but the last four of these are exactly the same as
1898  <pre>  for <b>pcre_exec()</b>, so their description is not repeated here.
1899    PCRE_PARTIAL  <pre>
1900  </pre>    PCRE_PARTIAL_HARD
1901  This has the same general effect as it does for <b>pcre_exec()</b>, but the    PCRE_PARTIAL_SOFT
1902  details are slightly different. When PCRE_PARTIAL is set for  </pre>
1903  <b>pcre_dfa_exec()</b>, the return code PCRE_ERROR_NOMATCH is converted into  These have the same general effect as they do for <b>pcre_exec()</b>, but the
1904  PCRE_ERROR_PARTIAL if the end of the subject is reached, there have been no  details are slightly different. When PCRE_PARTIAL_HARD is set for
1905  complete matches, but there is still at least one matching possibility. The  <b>pcre_dfa_exec()</b>, it returns PCRE_ERROR_PARTIAL if the end of the subject
1906  portion of the string that provided the partial match is set as the first  is reached and there is still at least one matching possibility that requires
1907  matching string.  additional characters. This happens even if some complete matches have also
1908    been found. When PCRE_PARTIAL_SOFT is set, the return code PCRE_ERROR_NOMATCH
1909    is converted into PCRE_ERROR_PARTIAL if the end of the subject is reached,
1910    there have been no complete matches, but there is still at least one matching
1911    possibility. The portion of the string that was inspected when the longest
1912    partial match was found is set as the first matching string in both cases.
1913  <pre>  <pre>
1914    PCRE_DFA_SHORTEST    PCRE_DFA_SHORTEST
1915  </pre>  </pre>
# Line 1870  matching point in the subject string. Line 1920  matching point in the subject string.
1920  <pre>  <pre>
1921    PCRE_DFA_RESTART    PCRE_DFA_RESTART
1922  </pre>  </pre>
1923  When <b>pcre_dfa_exec()</b> is called with the PCRE_PARTIAL option, and returns  When <b>pcre_dfa_exec()</b> returns a partial match, it is possible to call it
1924  a partial match, it is possible to call it again, with additional subject  again, with additional subject characters, and have it continue with the same
1925  characters, and have it continue with the same match. The PCRE_DFA_RESTART  match. The PCRE_DFA_RESTART option requests this action; when it is set, the
1926  option requests this action; when it is set, the <i>workspace</i> and  <i>workspace</i> and <i>wscount</i> options must reference the same vector as
1927  <i>wscount</i> options must reference the same vector as before because data  before because data about the match so far is left in them after a partial
1928  about the match so far is left in them after a partial match. There is more  match. There is more discussion of this facility in the
 discussion of this facility in the  
1929  <a href="pcrepartial.html"><b>pcrepartial</b></a>  <a href="pcrepartial.html"><b>pcrepartial</b></a>
1930  documentation.  documentation.
1931  </P>  </P>
# Line 1972  Cambridge CB2 3QH, England. Line 2021  Cambridge CB2 3QH, England.
2021  </P>  </P>
2022  <br><a name="SEC22" href="#TOC1">REVISION</a><br>  <br><a name="SEC22" href="#TOC1">REVISION</a><br>
2023  <P>  <P>
2024  Last updated: 12 April 2008  Last updated: 22 September 2009
2025  <br>  <br>
2026  Copyright &copy; 1997-2008 University of Cambridge.  Copyright &copy; 1997-2009 University of Cambridge.
2027  <br>  <br>
2028  <p>  <p>
2029  Return to the <a href="index.html">PCRE index page</a>.  Return to the <a href="index.html">PCRE index page</a>.

Legend:
Removed from v.345  
changed lines
  Added in v.454

  ViewVC Help
Powered by ViewVC 1.1.5