| 201 |
<pre> |
<pre> |
| 202 |
/caseless/i |
/caseless/i |
| 203 |
</pre> |
</pre> |
| 204 |
The following table shows additional modifiers for setting PCRE options that do |
The following table shows additional modifiers for setting PCRE compile-time |
| 205 |
not correspond to anything in Perl: |
options that do not correspond to anything in Perl: |
| 206 |
<pre> |
<pre> |
| 207 |
<b>/8</b> PCRE_UTF8 |
<b>/8</b> PCRE_UTF8 |
| 208 |
<b>/?</b> PCRE_NO_UTF8_CHECK |
<b>/?</b> PCRE_NO_UTF8_CHECK |
| 209 |
<b>/A</b> PCRE_ANCHORED |
<b>/A</b> PCRE_ANCHORED |
| 210 |
<b>/C</b> PCRE_AUTO_CALLOUT |
<b>/C</b> PCRE_AUTO_CALLOUT |
| 211 |
<b>/E</b> PCRE_DOLLAR_ENDONLY |
<b>/E</b> PCRE_DOLLAR_ENDONLY |
| 213 |
<b>/J</b> PCRE_DUPNAMES |
<b>/J</b> PCRE_DUPNAMES |
| 214 |
<b>/N</b> PCRE_NO_AUTO_CAPTURE |
<b>/N</b> PCRE_NO_AUTO_CAPTURE |
| 215 |
<b>/U</b> PCRE_UNGREEDY |
<b>/U</b> PCRE_UNGREEDY |
| 216 |
<b>/W</b> PCRE_UCP |
<b>/W</b> PCRE_UCP |
| 217 |
<b>/X</b> PCRE_EXTRA |
<b>/X</b> PCRE_EXTRA |
| 218 |
<b>/<JS></b> PCRE_JAVASCRIPT_COMPAT |
<b>/<JS></b> PCRE_JAVASCRIPT_COMPAT |
| 219 |
<b>/<cr></b> PCRE_NEWLINE_CR |
<b>/<cr></b> PCRE_NEWLINE_CR |
| 235 |
\x{hh...} notation if they are valid UTF-8 sequences. Full details of the PCRE |
\x{hh...} notation if they are valid UTF-8 sequences. Full details of the PCRE |
| 236 |
options are given in the |
options are given in the |
| 237 |
<a href="pcreapi.html"><b>pcreapi</b></a> |
<a href="pcreapi.html"><b>pcreapi</b></a> |
| 238 |
documentation. |
documentation. |
| 239 |
</P> |
</P> |
| 240 |
<br><b> |
<br><b> |
| 241 |
Finding all matches in a string |
Finding all matches in a string |
| 326 |
pattern to be output. |
pattern to be output. |
| 327 |
</P> |
</P> |
| 328 |
<P> |
<P> |
|
The <b>/P</b> modifier causes <b>pcretest</b> to call PCRE via the POSIX wrapper |
|
|
API rather than its native API. When this is done, all other modifiers except |
|
|
<b>/i</b>, <b>/m</b>, and <b>/+</b> are ignored. REG_ICASE is set if <b>/i</b> is |
|
|
present, and REG_NEWLINE is set if <b>/m</b> is present. The wrapper functions |
|
|
force PCRE_DOLLAR_ENDONLY always, and PCRE_DOTALL unless REG_NEWLINE is set. |
|
|
</P> |
|
|
<P> |
|
| 329 |
The <b>/S</b> modifier causes <b>pcre_study()</b> to be called after the |
The <b>/S</b> modifier causes <b>pcre_study()</b> to be called after the |
| 330 |
expression has been compiled, and the results used when the expression is |
expression has been compiled, and the results used when the expression is |
| 331 |
matched. |
matched. |
| 332 |
</P> |
</P> |
| 333 |
|
<br><b> |
| 334 |
|
Using the POSIX wrapper API |
| 335 |
|
</b><br> |
| 336 |
|
<P> |
| 337 |
|
The <b>/P</b> modifier causes <b>pcretest</b> to call PCRE via the POSIX wrapper |
| 338 |
|
API rather than its native API. When <b>/P</b> is set, the following modifiers |
| 339 |
|
set options for the <b>regcomp()</b> function: |
| 340 |
|
<pre> |
| 341 |
|
/i REG_ICASE |
| 342 |
|
/m REG_NEWLINE |
| 343 |
|
/N REG_NOSUB |
| 344 |
|
/s REG_DOTALL ) |
| 345 |
|
/U REG_UNGREEDY ) These options are not part of |
| 346 |
|
/W REG_UCP ) the POSIX standard |
| 347 |
|
/8 REG_UTF8 ) |
| 348 |
|
</pre> |
| 349 |
|
The <b>/+</b> modifier works as described above. All other modifiers are |
| 350 |
|
ignored. |
| 351 |
|
</P> |
| 352 |
<br><a name="SEC5" href="#TOC1">DATA LINES</a><br> |
<br><a name="SEC5" href="#TOC1">DATA LINES</a><br> |
| 353 |
<P> |
<P> |
| 354 |
Before each data line is passed to <b>pcre_exec()</b>, leading and trailing |
Before each data line is passed to <b>pcre_exec()</b>, leading and trailing |
| 435 |
</P> |
</P> |
| 436 |
<P> |
<P> |
| 437 |
If the <b>/P</b> modifier was present on the pattern, causing the POSIX wrapper |
If the <b>/P</b> modifier was present on the pattern, causing the POSIX wrapper |
| 438 |
API to be used, the only option-setting sequences that have any effect are \B |
API to be used, the only option-setting sequences that have any effect are \B, |
| 439 |
and \Z, causing REG_NOTBOL and REG_NOTEOL, respectively, to be passed to |
\N, and \Z, causing REG_NOTBOL, REG_NOTEMPTY, and REG_NOTEOL, respectively, |
| 440 |
<b>regexec()</b>. |
to be passed to <b>regexec()</b>. |
| 441 |
</P> |
</P> |
| 442 |
<P> |
<P> |
| 443 |
The use of \x{hh...} to represent UTF-8 characters is not dependent on the use |
The use of \x{hh...} to represent UTF-8 characters is not dependent on the use |
| 726 |
</P> |
</P> |
| 727 |
<br><a name="SEC15" href="#TOC1">REVISION</a><br> |
<br><a name="SEC15" href="#TOC1">REVISION</a><br> |
| 728 |
<P> |
<P> |
| 729 |
Last updated: 12 May 2010 |
Last updated: 16 May 2010 |
| 730 |
<br> |
<br> |
| 731 |
Copyright © 1997-2010 University of Cambridge. |
Copyright © 1997-2010 University of Cambridge. |
| 732 |
<br> |
<br> |