Main Page | Modules | Namespace List | Class Hierarchy | Alphabetical List | Class List | File List | Namespace Members | Class Members | File Members | Related Pages

MNRegex.h

Go to the documentation of this file.
00001 // This may look like C code, but it is really -*- C++ -*- 00002 /* 00003 Copyright (C) 1988 Free Software Foundation 00004 written by Doug Lea (dl@rocky.oswego.edu) 00005 00006 This file is part of the GNU C++ Library. This library is free 00007 software; you can redistribute it and/or modify it under the terms of 00008 the GNU Library General Public License as published by the Free 00009 Software Foundation; either version 2 of the License, or (at your 00010 option) any later version. This library is distributed in the hope 00011 that it will be useful, but WITHOUT ANY WARRANTY; without even the 00012 implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR 00013 PURPOSE. See the GNU Library General Public License for more details. 00014 You should have received a copy of the GNU Library General Public 00015 License along with this library; if not, write to the Free Software 00016 Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 00017 */ 00018 00024 00025 00026 #ifndef _MNRegex_h 00027 #ifdef __GNUG__ 00028 #pragma interface 00029 #endif 00030 #define _MNRegex_h 1 00031 00032 #undef OK 00033 00034 #if defined(SHORT_NAMES) || defined(VMS) 00035 #define re_compile_pattern recmppat 00036 #define re_pattern_buffer repatbuf 00037 #define re_registers reregs 00038 #endif 00039 00040 struct re_pattern_buffer; // defined elsewhere 00041 struct re_registers; 00042 00043 class MNRegex 00044 { 00045 private: 00046 00047 MNRegex(const MNRegex&) {} // no X(X&) 00048 void operator = (const MNRegex&) {} // no assignment 00049 00050 protected: 00051 re_pattern_buffer* buf; 00052 re_registers* reg; 00053 00054 public: 00055 MNRegex(const char* t, 00056 int fast = 0, 00057 int bufsize = 40, 00058 const char* transtable = 0); 00059 00060 ~MNRegex(); 00061 00062 int match(const char* s, int len, int pos = 0) const; 00063 int search(const char* s, int len, 00064 int& matchlen, int startpos = 0) const; 00065 int match_info(int& start, int& length, int nth = 0) const; 00066 00067 int OK() const; // representation invariant 00068 }; 00069 00070 // some built in regular expressions 00071 00072 extern const MNRegex RXwhite; // = "[ \n\t\r\v\f]+" 00073 extern const MNRegex RXint; // = "-?[0-9]+" 00074 extern const MNRegex RXdouble; // = "-?\\(\\([0-9]+\\.[0-9]*\\)\\| 00075 // \\([0-9]+\\)\\|\\(\\.[0-9]+\\)\\) 00076 // \\([eE][---+]?[0-9]+\\)?" 00077 extern const MNRegex RXalpha; // = "[A-Za-z]+" 00078 extern const MNRegex RXlowercase; // = "[a-z]+" 00079 extern const MNRegex RXuppercase; // = "[A-Z]+" 00080 extern const MNRegex RXalphanum; // = "[0-9A-Za-z]+" 00081 extern const MNRegex RXidentifier; // = "[A-Za-z_][A-Za-z0-9_]*" 00082 00083 00084 #endif

Generated on Sun Mar 6 13:35:49 2005 for Komssys by doxygen 1.3.8