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