Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2)

Side by Side Diff: third_party/re2/re2/regexp.h

Issue 10873029: Migrate WebRequestRedirectByRegExAction to use RE2 and roll RE2 to revision 97:401ab4168e8e (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Merged with ToT Created 8 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « third_party/re2/re2/re2.cc ('k') | third_party/re2/re2/regexp.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2006 The RE2 Authors. All Rights Reserved. 1 // Copyright 2006 The RE2 Authors. All Rights Reserved.
2 // Use of this source code is governed by a BSD-style 2 // Use of this source code is governed by a BSD-style
3 // license that can be found in the LICENSE file. 3 // license that can be found in the LICENSE file.
4 4
5 // --- SPONSORED LINK -------------------------------------------------- 5 // --- SPONSORED LINK --------------------------------------------------
6 // If you want to use this library for regular expression matching, 6 // If you want to use this library for regular expression matching,
7 // you should use re2/re2.h, which provides a class RE2 that 7 // you should use re2/re2.h, which provides a class RE2 that
8 // mimics the PCRE interface provided by PCRE's C++ wrappers. 8 // mimics the PCRE interface provided by PCRE's C++ wrappers.
9 // This header describes the low-level interface used to implement RE2 9 // This header describes the low-level interface used to implement RE2
10 // and may change in backwards-incompatible ways from time to time. 10 // and may change in backwards-incompatible ways from time to time.
(...skipping 179 matching lines...) Expand 10 before | Expand all | Expand 10 after
190 void set_tmp(string* tmp) { delete tmp_; tmp_ = tmp; } 190 void set_tmp(string* tmp) { delete tmp_; tmp_ = tmp; }
191 enum RegexpStatusCode code() const { return code_; } 191 enum RegexpStatusCode code() const { return code_; }
192 const StringPiece& error_arg() const { return error_arg_; } 192 const StringPiece& error_arg() const { return error_arg_; }
193 bool ok() const { return code() == kRegexpSuccess; } 193 bool ok() const { return code() == kRegexpSuccess; }
194 194
195 // Copies state from status. 195 // Copies state from status.
196 void Copy(const RegexpStatus& status); 196 void Copy(const RegexpStatus& status);
197 197
198 // Returns text equivalent of code, e.g.: 198 // Returns text equivalent of code, e.g.:
199 // "Bad character class" 199 // "Bad character class"
200 static const string& CodeText(enum RegexpStatusCode code); 200 static string CodeText(enum RegexpStatusCode code);
201 201
202 // Returns text describing error, e.g.: 202 // Returns text describing error, e.g.:
203 // "Bad character class: [z-a]" 203 // "Bad character class: [z-a]"
204 string Text() const; 204 string Text() const;
205 205
206 private: 206 private:
207 enum RegexpStatusCode code_; // Kind of error 207 enum RegexpStatusCode code_; // Kind of error
208 StringPiece error_arg_; // Piece of regexp containing syntax error. 208 StringPiece error_arg_; // Piece of regexp containing syntax error.
209 string* tmp_; // Temporary storage, possibly where error_arg_ is. 209 string* tmp_; // Temporary storage, possibly where error_arg_ is.
210 210
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after
292 // s - DotNL 292 // s - DotNL
293 // U - NonGreedy 293 // U - NonGreedy
294 // line ends: \A \z 294 // line ends: \A \z
295 // \Q and \E to disable/enable metacharacters 295 // \Q and \E to disable/enable metacharacters
296 // (?P<name>expr) for named captures 296 // (?P<name>expr) for named captures
297 // \C to match any single byte 297 // \C to match any single byte
298 UnicodeGroups = 1<<10, // Allow \p{Han} for Unicode Han group 298 UnicodeGroups = 1<<10, // Allow \p{Han} for Unicode Han group
299 // and \P{Han} for its negation. 299 // and \P{Han} for its negation.
300 NeverNL = 1<<11, // Never match NL, even if the regexp mentions 300 NeverNL = 1<<11, // Never match NL, even if the regexp mentions
301 // it explicitly. 301 // it explicitly.
302 NeverCapture = 1<<12, // Parse all parens as non-capturing.
302 303
303 // As close to Perl as we can get. 304 // As close to Perl as we can get.
304 LikePerl = ClassNL | OneLine | PerlClasses | PerlB | PerlX | 305 LikePerl = ClassNL | OneLine | PerlClasses | PerlB | PerlX |
305 UnicodeGroups, 306 UnicodeGroups,
306 307
307 // Internal use only. 308 // Internal use only.
308 WasDollar = 1<<15, // on kRegexpEndText: was $ in regexp text 309 WasDollar = 1<<15, // on kRegexpEndText: was $ in regexp text
309 }; 310 };
310 311
311 // Get. No set, Regexps are logically immutable once created. 312 // Get. No set, Regexps are logically immutable once created.
(...skipping 311 matching lines...) Expand 10 before | Expand all | Expand 10 after
623 inline Regexp::ParseFlags operator~(Regexp::ParseFlags a) 624 inline Regexp::ParseFlags operator~(Regexp::ParseFlags a)
624 { 625 {
625 return static_cast<Regexp::ParseFlags>(~static_cast<int>(a)); 626 return static_cast<Regexp::ParseFlags>(~static_cast<int>(a));
626 } 627 }
627 628
628 629
629 630
630 } // namespace re2 631 } // namespace re2
631 632
632 #endif // RE2_REGEXP_H__ 633 #endif // RE2_REGEXP_H__
OLDNEW
« no previous file with comments | « third_party/re2/re2/re2.cc ('k') | third_party/re2/re2/regexp.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698