| 113 |
default, this is any Unicode newline sequence, for Perl compatibility. However, |
default, this is any Unicode newline sequence, for Perl compatibility. However, |
| 114 |
this can be changed; see the description of \R in the section entitled |
this can be changed; see the description of \R in the section entitled |
| 115 |
<a href="#newlineseq">"Newline sequences"</a> |
<a href="#newlineseq">"Newline sequences"</a> |
| 116 |
below. |
below. A change of \R setting can be combined with a change of newline |
| 117 |
|
convention. |
| 118 |
</P> |
</P> |
| 119 |
<br><a name="SEC3" href="#TOC1">CHARACTERS AND METACHARACTERS</a><br> |
<br><a name="SEC3" href="#TOC1">CHARACTERS AND METACHARACTERS</a><br> |
| 120 |
<P> |
<P> |
| 428 |
<P> |
<P> |
| 429 |
It is possible to restrict \R to match only CR, LF, or CRLF (instead of the |
It is possible to restrict \R to match only CR, LF, or CRLF (instead of the |
| 430 |
complete set of Unicode line endings) by setting the option PCRE_BSR_ANYCRLF |
complete set of Unicode line endings) by setting the option PCRE_BSR_ANYCRLF |
| 431 |
either at compile time or when the pattern is matched. This can be made the |
either at compile time or when the pattern is matched. (BSR is an abbrevation |
| 432 |
default when PCRE is built; if this is the case, the other behaviour can be |
for "backslash R".) This can be made the default when PCRE is built; if this is |
| 433 |
requested via the PCRE_BSR_UNICODE option. It is also possible to specify these |
the case, the other behaviour can be requested via the PCRE_BSR_UNICODE option. |
| 434 |
settings by starting a pattern string with one of the following sequences: |
It is also possible to specify these settings by starting a pattern string with |
| 435 |
|
one of the following sequences: |
| 436 |
<pre> |
<pre> |
| 437 |
(*BSR_ANYCRLF) CR, LF, or CRLF only |
(*BSR_ANYCRLF) CR, LF, or CRLF only |
| 438 |
(*BSR_UNICODE) any Unicode newline sequence |
(*BSR_UNICODE) any Unicode newline sequence |
| 441 |
they can be overridden by options given to <b>pcre_exec()</b>. Note that these |
they can be overridden by options given to <b>pcre_exec()</b>. Note that these |
| 442 |
special settings, which are not Perl-compatible, are recognized only at the |
special settings, which are not Perl-compatible, are recognized only at the |
| 443 |
very start of a pattern, and that they must be in upper case. If more than one |
very start of a pattern, and that they must be in upper case. If more than one |
| 444 |
of them is present, the last one is used. |
of them is present, the last one is used. They can be combined with a change of |
| 445 |
</P> |
newline convention, for example, a pattern can start with: |
| 446 |
<P> |
<pre> |
| 447 |
|
(*ANY)(*BSR_ANYCRLF) |
| 448 |
|
</pre> |
| 449 |
Inside a character class, \R matches the letter "R". |
Inside a character class, \R matches the letter "R". |
| 450 |
<a name="uniextseq"></a></P> |
<a name="uniextseq"></a></P> |
| 451 |
<br><b> |
<br><b> |
| 2189 |
</P> |
</P> |
| 2190 |
<br><a name="SEC27" href="#TOC1">REVISION</a><br> |
<br><a name="SEC27" href="#TOC1">REVISION</a><br> |
| 2191 |
<P> |
<P> |
| 2192 |
Last updated: 11 September 2007 |
Last updated: 14 September 2007 |
| 2193 |
<br> |
<br> |
| 2194 |
Copyright © 1997-2007 University of Cambridge. |
Copyright © 1997-2007 University of Cambridge. |
| 2195 |
<br> |
<br> |