/[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 227 by ph10, Tue Aug 21 15:00:15 2007 UTC revision 292 by ph10, Thu Dec 27 09:27:23 2007 UTC
# Line 276  metacharacters, the handling of #-commen Line 276  metacharacters, the handling of #-commen
276  recognized line ending sequence, the match position advancement for a  recognized line ending sequence, the match position advancement for a
277  non-anchored pattern. There is more detail about this in the  non-anchored pattern. There is more detail about this in the
278  <a href="#execoptions">section on <b>pcre_exec()</b> options</a>  <a href="#execoptions">section on <b>pcre_exec()</b> options</a>
279  below. The choice of newline convention does not affect the interpretation of  below.
280  the \n or \r escape sequences.  </P>
281    <P>
282    The choice of newline convention does not affect the interpretation of
283    the \n or \r escape sequences, nor does it affect what \R matches, which is
284    controlled in a similar way, but by separate options.
285  </P>  </P>
286  <br><a name="SEC4" href="#TOC1">MULTITHREADING</a><br>  <br><a name="SEC4" href="#TOC1">MULTITHREADING</a><br>
287  <P>  <P>
# Line 332  that is recognized as meaning "newline". Line 336  that is recognized as meaning "newline".
336  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. The
337  default should normally be the standard sequence for your operating system.  default should normally be the standard sequence for your operating system.
338  <pre>  <pre>
339      PCRE_CONFIG_BSR
340    </pre>
341    The output is an integer whose value indicates what character sequences the \R
342    escape sequence matches by default. A value of 0 means that \R matches any
343    Unicode line ending sequence; a value of 1 means that \R matches only CR, LF,
344    or CRLF. The default can be overridden when a pattern is compiled or matched.
345    <pre>
346    PCRE_CONFIG_LINK_SIZE    PCRE_CONFIG_LINK_SIZE
347  </pre>  </pre>
348  The output is an integer that contains the number of bytes used for internal  The output is an integer that contains the number of bytes used for internal
# Line 467  facility, see the Line 478  facility, see the
478  <a href="pcrecallout.html"><b>pcrecallout</b></a>  <a href="pcrecallout.html"><b>pcrecallout</b></a>
479  documentation.  documentation.
480  <pre>  <pre>
481      PCRE_BSR_ANYCRLF
482      PCRE_BSR_UNICODE
483    </pre>
484    These options (which are mutually exclusive) control what the \R escape
485    sequence matches. The choice is either to match only CR, LF, or CRLF, or to
486    match any Unicode newline sequence. The default is specified when PCRE is
487    built. It can be overridden from within the pattern, or by setting an option
488    when a compiled pattern is matched.
489    <pre>
490    PCRE_CASELESS    PCRE_CASELESS
491  </pre>  </pre>
492  If this bit is set, letters in the pattern match both upper and lower case  If this bit is set, letters in the pattern match both upper and lower case
# Line 653  out of use. To avoid confusion, they hav Line 673  out of use. To avoid confusion, they hav
673     9  nothing to repeat     9  nothing to repeat
674    10  [this code is not in use]    10  [this code is not in use]
675    11  internal error: unexpected repeat    11  internal error: unexpected repeat
676    12  unrecognized character after (?    12  unrecognized character after (? or (?-
677    13  POSIX named classes are supported only within a class    13  POSIX named classes are supported only within a class
678    14  missing )    14  missing )
679    15  reference to non-existent subpattern    15  reference to non-existent subpattern
# Line 661  out of use. To avoid confusion, they hav Line 681  out of use. To avoid confusion, they hav
681    17  unknown option bit(s) set    17  unknown option bit(s) set
682    18  missing ) after comment    18  missing ) after comment
683    19  [this code is not in use]    19  [this code is not in use]
684    20  regular expression too large    20  regular expression is too large
685    21  failed to get memory    21  failed to get memory
686    22  unmatched parentheses    22  unmatched parentheses
687    23  internal error: code overflow    23  internal error: code overflow
# Line 690  out of use. To avoid confusion, they hav Line 710  out of use. To avoid confusion, they hav
710    46  malformed \P or \p sequence    46  malformed \P or \p sequence
711    47  unknown property name after \P or \p    47  unknown property name after \P or \p
712    48  subpattern name is too long (maximum 32 characters)    48  subpattern name is too long (maximum 32 characters)
713    49  too many named subpatterns (maximum 10,000)    49  too many named subpatterns (maximum 10000)
714    50  [this code is not in use]    50  [this code is not in use]
715    51  octal value is greater than \377 (not in UTF-8 mode)    51  octal value is greater than \377 (not in UTF-8 mode)
716    52  internal error: overran compiling workspace    52  internal error: overran compiling workspace
717    53  internal error: previously-checked referenced subpattern not found    53  internal error: previously-checked referenced subpattern not found
718    54  DEFINE group contains more than one branch    54  DEFINE group contains more than one branch
719    55  repeating a DEFINE group is not allowed    55  repeating a DEFINE group is not allowed
720    56  inconsistent NEWLINE options"    56  inconsistent NEWLINE options
721    57  \g is not followed by a braced name or an optionally braced    57  \g is not followed by a braced name or an optionally braced
722          non-zero number          non-zero number
723    58  (?+ or (?- or (?(+ or (?(- must be followed by a non-zero number    58  (?+ or (?- or (?(+ or (?(- must be followed by a non-zero number
724  </PRE>    59  (*VERB) with an argument is not supported
725      60  (*VERB) not recognized
726      61  number is too big
727      62  subpattern name expected
728      63  digit expected after (?+
729    </pre>
730    The numbers 32 and 10000 in errors 48 and 49 are defaults; different values may
731    be used if the limits were changed when PCRE was built.
732  </P>  </P>
733  <br><a name="SEC9" href="#TOC1">STUDYING A PATTERN</a><br>  <br><a name="SEC9" href="#TOC1">STUDYING A PATTERN</a><br>
734  <P>  <P>
# Line 906  fourth argument should point to an <b>un Line 933  fourth argument should point to an <b>un
933    PCRE_INFO_HASCRORLF    PCRE_INFO_HASCRORLF
934  </pre>  </pre>
935  Return 1 if the pattern contains any explicit matches for CR or LF characters,  Return 1 if the pattern contains any explicit matches for CR or LF characters,
936  otherwise 0. The fourth argument should point to an <b>int</b> variable.  otherwise 0. The fourth argument should point to an <b>int</b> variable. An
937    explicit match is either a literal CR or LF character, or \r or \n.
938  <pre>  <pre>
939    PCRE_INFO_JCHANGED    PCRE_INFO_JCHANGED
940  </pre>  </pre>
941  Return 1 if the (?J) option setting is used in the pattern, otherwise 0. The  Return 1 if the (?J) or (?-J) option setting is used in the pattern, otherwise
942  fourth argument should point to an <b>int</b> variable. The (?J) internal option  0. The fourth argument should point to an <b>int</b> variable. (?J) and
943  setting changes the local PCRE_DUPNAMES option.  (?-J) set and unset the local PCRE_DUPNAMES option, respectively.
944  <pre>  <pre>
945    PCRE_INFO_LASTLITERAL    PCRE_INFO_LASTLITERAL
946  </pre>  </pre>
# Line 1206  matching position. If a pattern was comp Line 1234  matching position. If a pattern was comp
1234  to be anchored by virtue of its contents, it cannot be made unachored at  to be anchored by virtue of its contents, it cannot be made unachored at
1235  matching time.  matching time.
1236  <pre>  <pre>
1237      PCRE_BSR_ANYCRLF
1238      PCRE_BSR_UNICODE
1239    </pre>
1240    These options (which are mutually exclusive) control what the \R escape
1241    sequence matches. The choice is either to match only CR, LF, or CRLF, or to
1242    match any Unicode newline sequence. These options override the choice that was
1243    made or defaulted when the pattern was compiled.
1244    <pre>
1245    PCRE_NEWLINE_CR    PCRE_NEWLINE_CR
1246    PCRE_NEWLINE_LF    PCRE_NEWLINE_LF
1247    PCRE_NEWLINE_CRLF    PCRE_NEWLINE_CRLF
# Line 1222  pattern. Line 1258  pattern.
1258  <P>  <P>
1259  When PCRE_NEWLINE_CRLF, PCRE_NEWLINE_ANYCRLF, or PCRE_NEWLINE_ANY is set, and a  When PCRE_NEWLINE_CRLF, PCRE_NEWLINE_ANYCRLF, or PCRE_NEWLINE_ANY is set, and a
1260  match attempt for an unanchored pattern fails when the current position is at a  match attempt for an unanchored pattern fails when the current position is at a
1261  CRLF sequence, and the pattern contains no explicit matches for CR or NL  CRLF sequence, and the pattern contains no explicit matches for CR or LF
1262  characters, the match position is advanced by two characters instead of one, in  characters, the match position is advanced by two characters instead of one, in
1263  other words, to after the CRLF.  other words, to after the CRLF.
1264  </P>  </P>
# Line 1233  set), it does not match the string "\r\n Line 1269  set), it does not match the string "\r\n
1269  start, it skips both the CR and the LF before retrying. However, the pattern  start, it skips both the CR and the LF before retrying. However, the pattern
1270  [\r\n]A does match that string, because it contains an explicit CR or LF  [\r\n]A does match that string, because it contains an explicit CR or LF
1271  reference, and so advances only by one character after the first failure.  reference, and so advances only by one character after the first failure.
1272  Note than an explicit CR or LF reference occurs for negated character classes  </P>
1273  such as [^X] because they can match CR or LF characters.  <P>
1274    An explicit match for CR of LF is either a literal appearance of one of those
1275    characters, or one of the \r or \n escape sequences. Implicit matches such as
1276    [^X] do not count, nor does \s (which includes CR and LF in the characters
1277    that it matches).
1278  </P>  </P>
1279  <P>  <P>
1280  Notwithstanding the above, anomalous effects may still occur when CRLF is a  Notwithstanding the above, anomalous effects may still occur when CRLF is a
# Line 1915  Cambridge CB2 3QH, England. Line 1955  Cambridge CB2 3QH, England.
1955  </P>  </P>
1956  <br><a name="SEC22" href="#TOC1">REVISION</a><br>  <br><a name="SEC22" href="#TOC1">REVISION</a><br>
1957  <P>  <P>
1958  Last updated: 21 August 2007  Last updated: 26 December 2007
1959  <br>  <br>
1960  Copyright &copy; 1997-2007 University of Cambridge.  Copyright &copy; 1997-2007 University of Cambridge.
1961  <br>  <br>

Legend:
Removed from v.227  
changed lines
  Added in v.292

  ViewVC Help
Powered by ViewVC 1.1.5