5 |
.rs |
.rs |
6 |
.sp |
.sp |
7 |
.B #include <pcrecpp.h> |
.B #include <pcrecpp.h> |
8 |
.PP |
. |
|
.SM |
|
|
.br |
|
9 |
.SH DESCRIPTION |
.SH DESCRIPTION |
10 |
.rs |
.rs |
11 |
.sp |
.sp |
79 |
.sp |
.sp |
80 |
c. The "i"th argument has a suitable type for holding the |
c. The "i"th argument has a suitable type for holding the |
81 |
string captured as the "i"th sub-pattern. If you pass in |
string captured as the "i"th sub-pattern. If you pass in |
82 |
NULL for the "i"th argument, or pass fewer arguments than |
void * NULL for the "i"th argument, or a non-void * NULL |
83 |
|
of the correct type, or pass fewer arguments than the |
84 |
number of sub-patterns, "i"th captured sub-pattern is |
number of sub-patterns, "i"th captured sub-pattern is |
85 |
ignored. |
ignored. |
86 |
.sp |
.sp |
87 |
|
CAVEAT: An optional sub-pattern that does not exist in the matched |
88 |
|
string is assigned the empty string. Therefore, the following will |
89 |
|
return false (because the empty string is not a valid number): |
90 |
|
.sp |
91 |
|
int number; |
92 |
|
pcrecpp::RE::FullMatch("abc", "[a-z]+(\e\ed+)?", &number); |
93 |
|
.sp |
94 |
The matching interface supports at most 16 arguments per call. |
The matching interface supports at most 16 arguments per call. |
95 |
If you need more, consider using the more general interface |
If you need more, consider using the more general interface |
96 |
\fBpcrecpp::RE::DoMatch\fP. See \fBpcrecpp.h\fP for the signature for |
\fBpcrecpp::RE::DoMatch\fP. See \fBpcrecpp.h\fP for the signature for |
97 |
\fBDoMatch\fP. |
\fBDoMatch\fP. |
98 |
. |
. |
99 |
|
.SH "QUOTING METACHARACTERS" |
100 |
|
.rs |
101 |
|
.sp |
102 |
|
You can use the "QuoteMeta" operation to insert backslashes before all |
103 |
|
potentially meaningful characters in a string. The returned string, used as a |
104 |
|
regular expression, will exactly match the original string. |
105 |
|
.sp |
106 |
|
Example: |
107 |
|
string quoted = RE::QuoteMeta(unquoted); |
108 |
|
.sp |
109 |
|
Note that it's legal to escape a character even if it has no special meaning in |
110 |
|
a regular expression -- so this function does that. (This also makes it |
111 |
|
identical to the perl function of the same name; see "perldoc -f quotemeta".) |
112 |
|
For example, "1.5-2.0?" becomes "1\e.5\e-2\e.0\e?". |
113 |
|
. |
114 |
.SH "PARTIAL MATCHES" |
.SH "PARTIAL MATCHES" |
115 |
.rs |
.rs |
116 |
.sp |
.sp |
328 |
.SH AUTHOR |
.SH AUTHOR |
329 |
.rs |
.rs |
330 |
.sp |
.sp |
331 |
|
.nf |
332 |
The C++ wrapper was contributed by Google Inc. |
The C++ wrapper was contributed by Google Inc. |
333 |
.br |
Copyright (c) 2007 Google Inc. |
334 |
Copyright (c) 2005 Google Inc. |
.fi |
335 |
|
. |
336 |
|
. |
337 |
|
.SH REVISION |
338 |
|
.rs |
339 |
|
.sp |
340 |
|
.nf |
341 |
|
Last updated: 12 November 2007 |
342 |
|
.fi |