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

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

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

revision 868 by ph10, Wed Nov 24 17:39:25 2010 UTC revision 869 by ph10, Sat Jan 14 11:16:23 2012 UTC
# Line 46  man page, in case the conversion went wr Line 46  man page, in case the conversion went wr
46  The full syntax and semantics of the regular expressions that are supported by  The full syntax and semantics of the regular expressions that are supported by
47  PCRE are described in the  PCRE are described in the
48  <a href="pcrepattern.html"><b>pcrepattern</b></a>  <a href="pcrepattern.html"><b>pcrepattern</b></a>
49  documentation. This document contains just a quick-reference summary of the  documentation. This document contains a quick-reference summary of the syntax.
 syntax.  
50  </P>  </P>
51  <br><a name="SEC2" href="#TOC1">QUOTING</a><br>  <br><a name="SEC2" href="#TOC1">QUOTING</a><br>
52  <P>  <P>
# Line 76  syntax. Line 75  syntax.
75  <pre>  <pre>
76    .          any character except newline;    .          any character except newline;
77                 in dotall mode, any character whatsoever                 in dotall mode, any character whatsoever
78    \C         one byte, even in UTF-8 mode (best avoided)    \C         one data unit, even in UTF mode (best avoided)
79    \d         a decimal digit    \d         a decimal digit
80    \D         a character that is not a decimal digit    \D         a character that is not a decimal digit
81    \h         a horizontal whitespace character    \h         a horizontal whitespace character
# Line 94  syntax. Line 93  syntax.
93    \X         an extended Unicode sequence    \X         an extended Unicode sequence
94  </pre>  </pre>
95  In PCRE, by default, \d, \D, \s, \S, \w, and \W recognize only ASCII  In PCRE, by default, \d, \D, \s, \S, \w, and \W recognize only ASCII
96  characters, even in UTF-8 mode. However, this can be changed by setting the  characters, even in a UTF mode. However, this can be changed by setting the
97  PCRE_UCP option.  PCRE_UCP option.
98  </P>  </P>
99  <br><a name="SEC5" href="#TOC1">GENERAL CATEGORY PROPERTIES FOR \p and \P</a><br>  <br><a name="SEC5" href="#TOC1">GENERAL CATEGORY PROPERTIES FOR \p and \P</a><br>
# Line 367  The following are recognized only at the Line 366  The following are recognized only at the
366  newline-setting options with similar syntax:  newline-setting options with similar syntax:
367  <pre>  <pre>
368    (*NO_START_OPT) no start-match optimization (PCRE_NO_START_OPTIMIZE)    (*NO_START_OPT) no start-match optimization (PCRE_NO_START_OPTIMIZE)
369    (*UTF8)         set UTF-8 mode (PCRE_UTF8)    (*UTF8)         set UTF-8 mode: 8-bit library (PCRE_UTF8)
370      (*UTF16)        set UTF-16 mode: 16-bit library (PCRE_UTF16)
371    (*UCP)          set PCRE_UCP (use Unicode properties for \d etc)    (*UCP)          set PCRE_UCP (use Unicode properties for \d etc)
372  </PRE>  </PRE>
373  </P>  </P>
# Line 439  The following act immediately they are r Line 439  The following act immediately they are r
439  <pre>  <pre>
440    (*ACCEPT)       force successful match    (*ACCEPT)       force successful match
441    (*FAIL)         force backtrack; synonym (*F)    (*FAIL)         force backtrack; synonym (*F)
442      (*MARK:NAME)    set name to be passed back; synonym (*:NAME)
443  </pre>  </pre>
444  The following act only when a subsequent match failure causes a backtrack to  The following act only when a subsequent match failure causes a backtrack to
445  reach them. They all force a match failure, but they differ in what happens  reach them. They all force a match failure, but they differ in what happens
# Line 447  pattern is not anchored. Line 448  pattern is not anchored.
448  <pre>  <pre>
449    (*COMMIT)       overall failure, no advance of starting point    (*COMMIT)       overall failure, no advance of starting point
450    (*PRUNE)        advance to next starting character    (*PRUNE)        advance to next starting character
451    (*SKIP)         advance start to current matching position    (*PRUNE:NAME)   equivalent to (*MARK:NAME)(*PRUNE)
452      (*SKIP)         advance to current matching position
453      (*SKIP:NAME)    advance to position corresponding to an earlier
454                      (*MARK:NAME); if not found, the (*SKIP) is ignored
455    (*THEN)         local failure, backtrack to next alternation    (*THEN)         local failure, backtrack to next alternation
456      (*THEN:NAME)    equivalent to (*MARK:NAME)(*THEN)
457  </PRE>  </PRE>
458  </P>  </P>
459  <br><a name="SEC22" href="#TOC1">NEWLINE CONVENTIONS</a><br>  <br><a name="SEC22" href="#TOC1">NEWLINE CONVENTIONS</a><br>
460  <P>  <P>
461  These are recognized only at the very start of the pattern or after a  These are recognized only at the very start of the pattern or after a
462  (*BSR_...) or (*UTF8) or (*UCP) option.  (*BSR_...), (*UTF8), (*UTF16) or (*UCP) option.
463  <pre>  <pre>
464    (*CR)           carriage return only    (*CR)           carriage return only
465    (*LF)           linefeed only    (*LF)           linefeed only
# Line 466  These are recognized only at the very st Line 471  These are recognized only at the very st
471  <br><a name="SEC23" href="#TOC1">WHAT \R MATCHES</a><br>  <br><a name="SEC23" href="#TOC1">WHAT \R MATCHES</a><br>
472  <P>  <P>
473  These are recognized only at the very start of the pattern or after a  These are recognized only at the very start of the pattern or after a
474  (*...) option that sets the newline convention or UTF-8 or UCP mode.  (*...) option that sets the newline convention or a UTF or UCP mode.
475  <pre>  <pre>
476    (*BSR_ANYCRLF)  CR, LF, or CRLF    (*BSR_ANYCRLF)  CR, LF, or CRLF
477    (*BSR_UNICODE)  any Unicode newline sequence    (*BSR_UNICODE)  any Unicode newline sequence
# Line 495  Cambridge CB2 3QH, England. Line 500  Cambridge CB2 3QH, England.
500  </P>  </P>
501  <br><a name="SEC27" href="#TOC1">REVISION</a><br>  <br><a name="SEC27" href="#TOC1">REVISION</a><br>
502  <P>  <P>
503  Last updated: 21 November 2010  Last updated: 10 January 2012
504  <br>  <br>
505  Copyright &copy; 1997-2010 University of Cambridge.  Copyright &copy; 1997-2012 University of Cambridge.
506  <br>  <br>
507  <p>  <p>
508  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.868  
changed lines
  Added in v.869

  ViewVC Help
Powered by ViewVC 1.1.5