Home | History | Annotate | Download | only in include

Lines Matching refs:RE

36 // C++ interface to the pcre regular-expression library.  RE supports
64 // pcrecpp::RE re("h.*o");
65 // re.FullMatch("hello");
68 // pcrecpp::RE re("e");
69 // !re.FullMatch("hello");
71 // Example: creating a temporary RE object:
72 // pcrecpp::RE("h.*o").FullMatch("hello");
77 // You can, as in the different examples above, store the RE object
78 // explicitly in a variable or use a temporary RE object. The
90 // pcrecpp::RE re("(\\w+):(\\d+)");
91 // re.FullMatch("ruby:1234", &s, &i);
94 // re.FullMatch("ruby:1234", &s);
97 // re.FullMatch("ruby:1234", NULL, &i);
100 // !re.FullMatch("ruby:1234567891234", NULL, &i);
103 // !pcrecpp::RE("\\w+:\\d+").FullMatch("ruby:1234", &s);
106 // !pcrecpp::RE("(.*)").FullMatch("ruby", &i);
119 // pcrecpp::RE::FullMatch("abc", "[a-z]+(\\d+)?", &number);
126 // pcrecpp::RE::DoMatch(). See pcrecpp.h for the signature for DoMatch.
135 // pcrecpp::RE("ell").PartialMatch("hello");
139 // pcrecpp::RE re("(\\d+)");
140 // re.PartialMatch("x*100 + 20", &number);
158 // pcrecpp::RE re(utf8_pattern, options);
159 // re.FullMatch(utf8_string);
162 // pcrecpp::RE re(utf8_pattern, pcrecpp::UTF8());
163 // re.FullMatch(utf8_string);
174 // to pass such modifiers to a RE class.
216 // Normally, to pass one or more modifiers to a RE class, you declare
218 // object to a RE constructor. Example:
223 // if (RE("HELLO", opt).PartialMatch("hello world")) ...
230 // RE(pattern, RE_Options(PCRE_CASELESS|PCRE_MULTILINE)).PartialMatch(str);
233 // RE(pattern,
247 // PCRE_CASELESS, PCRE_EXTENDED, and PCRE_MULTILINE to a RE with one
250 // RE(" ^ xyz \\s+ .* blah$", RE_Options()
261 // which represents a sub-range of a real string. Like RE, StringPiece
270 // pcrecpp::RE re("(\\w+) = (\\d+)\n");
271 // while (re.Consume(&input, &var, &value)) {
281 // pcrecpp::RE("(\\w+)").FindAndConsume(&input, &word)
295 // pcrecpp::RE re("(.*) (.*) (.*) (.*)");
296 // re.FullMatch("100 40 0100 0x40",
311 // pcrecpp::RE("b+").Replace("d", &s);
318 // Replacements are not subject to re-matching. E.g.,
321 // pcrecpp::RE("b+").GlobalReplace("d", &s);
352 /***** Compiling regular expressions: the RE class *****/
372 // RE(pattern, RE_Options(PCRE_CASELESS|PCRE_MULTILINE)).PartialMatch(str);
374 // RE(pattern,
382 // we're fine with the default destructor, copy constructor, etc.
506 // pre-compiled regular expression. An "RE" object is safe for
508 class RE {
511 // pass in a string or a "const char*" wherever an "RE" is expected.
512 RE(const string& pat) { Init(pat, NULL); }
513 RE(const string& pat, const RE_Options& option) { Init(pat, &option); }
514 RE(const char* pat) { Init(pat, NULL); }
515 RE(const char* pat, const RE_Options& option) { Init(pat, &option); }
516 RE(const unsigned char* pat) {
519 RE(const unsigned char* pat, const RE_Options& option) {
525 RE(const RE& re) { Init(re.pattern_, &re.options_); }
526 const RE& operator=(const RE& re) {
527 if (this != &re) {
531 // Init(re.pattern_.c_str(), &re.options_);
534 Init(re.pattern_, &re.options_);
540 ~RE();
542 // The string specification for this RE. E.g.
543 // RE re("ab*c?d+");
544 // re.pattern(); // "ab*c?d+"
547 // If RE could not be created properly, returns an error string.
661 // I.e. for RE("(foo)|(bar)|(baz)") it will return 2, 3, and 4 when matching
663 // When matching RE("(foo)|hello") against "hello", it will return 1.