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