| 180 |
<br><a name="SEC5" href="#TOC1">MATCHING A PATTERN</a><br> |
<br><a name="SEC5" href="#TOC1">MATCHING A PATTERN</a><br> |
| 181 |
<P> |
<P> |
| 182 |
The function <b>regexec()</b> is called to match a compiled pattern <i>preg</i> |
The function <b>regexec()</b> is called to match a compiled pattern <i>preg</i> |
| 183 |
against a given <i>string</i>, which is terminated by a zero byte, subject to |
against a given <i>string</i>, which is by default terminated by a zero byte |
| 184 |
the options in <i>eflags</i>. These can be: |
(but see REG_STARTEND below), subject to the options in <i>eflags</i>. These can |
| 185 |
|
be: |
| 186 |
<pre> |
<pre> |
| 187 |
REG_NOTBOL |
REG_NOTBOL |
| 188 |
</pre> |
</pre> |
| 193 |
</pre> |
</pre> |
| 194 |
The PCRE_NOTEOL option is set when calling the underlying PCRE matching |
The PCRE_NOTEOL option is set when calling the underlying PCRE matching |
| 195 |
function. |
function. |
| 196 |
|
<pre> |
| 197 |
|
REG_STARTEND |
| 198 |
|
</pre> |
| 199 |
|
The string is considered to start at <i>string</i> + <i>pmatch[0].rm_so</i> and |
| 200 |
|
to have a terminating NUL located at <i>string</i> + <i>pmatch[0].rm_eo</i> |
| 201 |
|
(there need not actually be a NUL at that location), regardless of the value of |
| 202 |
|
<i>nmatch</i>. This is a BSD extension, compatible with but not specified by |
| 203 |
|
IEEE Standard 1003.2 (POSIX.2), and should be used with caution in software |
| 204 |
|
intended to be portable to other systems. Note that a non-zero <i>rm_so</i> does |
| 205 |
|
not imply REG_NOTBOL; REG_STARTEND affects only the location of the string, not |
| 206 |
|
how it is matched. |
| 207 |
</P> |
</P> |
| 208 |
<P> |
<P> |
| 209 |
If the pattern was compiled with the REG_NOSUB flag, no data about any matched |
If the pattern was compiled with the REG_NOSUB flag, no data about any matched |
| 251 |
</P> |
</P> |
| 252 |
<br><a name="SEC9" href="#TOC1">REVISION</a><br> |
<br><a name="SEC9" href="#TOC1">REVISION</a><br> |
| 253 |
<P> |
<P> |
| 254 |
Last updated: 06 March 2007 |
Last updated: 05 April 2008 |
| 255 |
<br> |
<br> |
| 256 |
Copyright © 1997-2007 University of Cambridge. |
Copyright © 1997-2008 University of Cambridge. |
| 257 |
<br> |
<br> |
| 258 |
<p> |
<p> |
| 259 |
Return to the <a href="index.html">PCRE index page</a>. |
Return to the <a href="index.html">PCRE index page</a>. |