library: libCore #include "TRegexp.h" |
TRegexp
class description - header file - source file
viewCVS header - viewCVS source
class TRegexp
Function Members (Methods)
Display options:
Data Members
public:
enum EStatVal { | kOK | |
| kIllegal | |
| kNomem | |
| kToolong | |
}; | | |
private:
unsigned short* | fPattern | Compiled pattern |
TRegexp::EStatVal | fStat | Status |
static const unsigned int | fgMaxpat | Max length of compiled pattern |
TRegexp
Regular expression class.
'^' // start-of-line anchor
'$' // end-of-line anchor
'.' // matches any character
'[' // start a character class
']' // end a character class
'^' // negates character class if 1st character
'*' // Kleene closure (matches 0 or more)
'+' // Positive closure (1 or more)
'?' // Optional closure (0 or 1)
Standard classes like [:alnum:], [:alpha:], etc. are not supported,
only [a-zA-Z], [^ntf] and so on.
TRegexp(const char *re, Bool_t wildcard)
Create a regular expression from the input string. If wildcard is true
then the input string contains a wildcard expression (see MakeWildcard()).
TRegexp& operator=(const char *str)
Assignment operator taking a char* and assigning it to a regexp.
void GenPattern(const char *str)
Generate the regular expression pattern.
const char * MakeWildcard(const char *re)
This routine transforms a wildcarding regular expression into
a general regular expression used for pattern matching.
When using wildcards the regular expression is assumed to be
preceded by a "^" (BOL) and terminated by a "$" (EOL). Also, all
"*"'s (closures) are assumed to be preceded by a "." (i.e. any character,
except "/"'s) and all .'s are escaped (so *.ps is different from *.eps).
The special treatment of "/" allows the easy matching of pathnames, e.g.
"*.root" will match "aap.root", but not "pipo/aap.root".
Ssiz_t Index(const TString& string, Ssiz_t* len, Ssiz_t i)
Find the first occurance of the regexp in string and return the position.
Len is length of the matched string and i is the offset at which the
matching should start.
Author: Fons Rademakers 04/08/95
Last update: root/base:$Name: $:$Id: TRegexp.cxx,v 1.14 2006/10/07 18:01:59 rdm Exp $
Copyright (C) 1995-2000, Rene Brun and Fons Rademakers. *
ROOT page - Class index - Class Hierarchy - Top of the page
This page has been automatically generated. If you have any comments or suggestions about the page layout send a mail to ROOT support, or contact the developers with any questions or problems regarding ROOT.