--- code/trunk/doc/pcrecpp.3 2007/02/24 21:41:21 87 +++ code/trunk/doc/pcrecpp.3 2007/04/24 13:36:11 155 @@ -5,9 +5,7 @@ .rs .sp .B #include -.PP -.SM -.br +. .SH DESCRIPTION .rs .sp @@ -85,11 +83,33 @@ number of sub-patterns, "i"th captured sub-pattern is ignored. .sp +CAVEAT: An optional sub-pattern that does not exist in the matched +string is assigned the empty string. Therefore, the following will +return false (because the empty string is not a valid number): +.sp + int number; + pcrecpp::RE::FullMatch("abc", "[a-z]+(\e\ed+)?", &number); +.sp The matching interface supports at most 16 arguments per call. If you need more, consider using the more general interface \fBpcrecpp::RE::DoMatch\fP. See \fBpcrecpp.h\fP for the signature for \fBDoMatch\fP. . +.SH "QUOTING METACHARACTERS" +.rs +.sp +You can use the "QuoteMeta" operation to insert backslashes before all +potentially meaningful characters in a string. The returned string, used as a +regular expression, will exactly match the original string. +.sp + Example: + string quoted = RE::QuoteMeta(unquoted); +.sp +Note that it's legal to escape a character even if it has no special meaning in +a regular expression -- so this function does that. (This also makes it +identical to the perl function of the same name; see "perldoc -f quotemeta".) +For example, "1.5-2.0?" becomes "1\e.5\e-2\e.0\e?". +. .SH "PARTIAL MATCHES" .rs .sp @@ -307,6 +327,15 @@ .SH AUTHOR .rs .sp +.nf The C++ wrapper was contributed by Google Inc. -.br -Copyright (c) 2005 Google Inc. +Copyright (c) 2007 Google Inc. +.fi +. +. +.SH REVISION +.rs +.sp +.nf +Last updated: 06 March 2007 +.fi