~ubuntu-branches/ubuntu/utopic/pcre3/utopic-proposed

« back to all changes in this revision

Viewing changes to doc/html/pcreposix.html

  • Committer: Bazaar Package Importer
  • Author(s): Mark Baker
  • Date: 2010-05-07 21:18:05 UTC
  • mfrom: (1.1.9 upstream)
  • Revision ID: james.westby@ubuntu.com-20100507211805-hgyyr2003bmbu54m
Tags: 8.02-1
New upstream release

Show diffs side-by-side

added added

removed removed

Lines of Context:
59
59
call the native ones, it is also necessary to add <b>-lpcre</b>.
60
60
</P>
61
61
<P>
62
 
I have implemented only those option bits that can be reasonably mapped to PCRE
63
 
native options. In addition, the option REG_EXTENDED is defined with the value
64
 
zero. This has no effect, but since programs that are written to the POSIX
65
 
interface often use it, this makes it easier to slot in PCRE as a replacement
66
 
library. Other POSIX options are not even defined.
 
62
I have implemented only those POSIX option bits that can be reasonably mapped
 
63
to PCRE native options. In addition, the option REG_EXTENDED is defined with
 
64
the value zero. This has no effect, but since programs that are written to the
 
65
POSIX interface often use it, this makes it easier to slot in PCRE as a
 
66
replacement library. Other POSIX options are not even defined.
 
67
</P>
 
68
<P>
 
69
There are also some other options that are not defined by POSIX. These have
 
70
been added at the request of users who want to make use of certain
 
71
PCRE-specific features via the POSIX calling interface.
67
72
</P>
68
73
<P>
69
74
When PCRE is called via these functions, it is only the API that is POSIX-like
121
126
<i>nmatch</i> and <i>pmatch</i> arguments are ignored, and no captured strings
122
127
are returned.
123
128
<pre>
 
129
  REG_UNGREEDY
 
130
</pre>
 
131
The PCRE_UNGREEDY option is set when the regular expression is passed for
 
132
compilation to the native function. Note that REG_UNGREEDY is not part of the
 
133
POSIX standard.
 
134
<pre>
124
135
  REG_UTF8
125
136
</pre>
126
137
The PCRE_UTF8 option is set when the regular expression is passed for
134
145
particular, the way it handles newline characters in the subject string is the
135
146
Perl way, not the POSIX way. Note that setting PCRE_MULTILINE has only
136
147
<i>some</i> of the effects specified for REG_NEWLINE. It does not affect the way
137
 
newlines are matched by . (they aren't) or by a negative class such as [^a]
 
148
newlines are matched by . (they are not) or by a negative class such as [^a]
138
149
(they are).
139
150
</P>
140
151
<P>
143
154
is public: <i>re_nsub</i> contains the number of capturing subpatterns in
144
155
the regular expression. Various error codes are defined in the header file.
145
156
</P>
 
157
<P>
 
158
NOTE: If the yield of <b>regcomp()</b> is non-zero, you must not attempt to
 
159
use the contents of the <i>preg</i> structure. If, for example, you pass it to
 
160
<b>regexec()</b>, the result is undefined and your program is likely to crash.
 
161
</P>
146
162
<br><a name="SEC4" href="#TOC1">MATCHING NEWLINE CHARACTERS</a><br>
147
163
<P>
148
164
This area is not simple, because POSIX and Perl take different views of things.
189
205
The PCRE_NOTBOL option is set when calling the underlying PCRE matching
190
206
function.
191
207
<pre>
 
208
  REG_NOTEMPTY
 
209
</pre>
 
210
The PCRE_NOTEMPTY option is set when calling the underlying PCRE matching
 
211
function. Note that REG_NOTEMPTY is not part of the POSIX standard. However,
 
212
setting this option can give more POSIX-like behaviour in some situations.
 
213
<pre>
192
214
  REG_NOTEOL
193
215
</pre>
194
216
The PCRE_NOTEOL option is set when calling the underlying PCRE matching
211
233
<b>regexec()</b> are ignored.
212
234
</P>
213
235
<P>
 
236
If the value of <i>nmatch</i> is zero, or if the value <i>pmatch</i> is NULL,
 
237
no data about any matched strings is returned.
 
238
</P>
 
239
<P>
214
240
Otherwise,the portion of the string that was matched, and also any captured
215
241
substrings, are returned via the <i>pmatch</i> argument, which points to an
216
242
array of <i>nmatch</i> structures of type <i>regmatch_t</i>, containing the
251
277
</P>
252
278
<br><a name="SEC9" href="#TOC1">REVISION</a><br>
253
279
<P>
254
 
Last updated: 05 April 2008
 
280
Last updated: 02 September 2009
255
281
<br>
256
 
Copyright &copy; 1997-2008 University of Cambridge.
 
282
Copyright &copy; 1997-2009 University of Cambridge.
257
283
<br>
258
284
<p>
259
285
Return to the <a href="index.html">PCRE index page</a>.