Changeset 798 in webkit for trunk/JavaScriptCore/kjs/regexp.h
- Timestamp:
- Mar 21, 2002, 4:31:57 PM (23 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/JavaScriptCore/kjs/regexp.h
r6 r798 1 // -*- c-basic-offset: 2 -*- 1 2 /* 2 3 * This file is part of the KDE libraries … … 16 17 * License along with this library; if not, write to the Free Software 17 18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 19 * 20 * $Id$ 18 21 */ 19 22 … … 27 30 #ifdef HAVE_PCREPOSIX 28 31 #include <pcreposix.h> 32 #include <pcre.h> 29 33 #else // POSIX regex - not so good... 30 34 extern "C" { // bug with some libc5 distributions … … 39 43 class RegExp { 40 44 public: 41 enum { None , Global, IgnoreCase, Multiline};45 enum { None = 0, Global = 1, IgnoreCase = 2, Multiline = 4 }; 42 46 RegExp(const UString &p, int f = None); 43 47 ~RegExp(); 44 UString match(const UString &s, int i = -1, int *pos = 0L); 45 bool test(const UString &s, int i = -1); 48 UString match(const UString &s, int i = -1, int *pos = 0L, int **ovector = 0L); 49 // test is unused. The JS spec says that RegExp.test should use 50 // RegExp.exec, so it has to store $1 etc. 51 // bool test(const UString &s, int i = -1); 52 uint subPatterns() const { return nrSubPatterns; } 46 53 private: 47 54 const UString &pattern; 48 55 int flags; 56 57 #ifndef HAVE_PCREPOSIX 49 58 regex_t preg; 59 #else 60 pcre *pcregex; 61 #endif 62 uint nrSubPatterns; 50 63 51 64 RegExp();
Note:
See TracChangeset
for help on using the changeset viewer.