![]() |
ROOT
6.06/09
Reference Guide
|
Regular expression class.
Note that the '|' operator (union) is not supported, nor are parentheses (grouping). Therefore "a|b" does not match "a".
Standard classes like [:alnum:], [:alpha:], etc. are not supported, only [a-zA-Z], [^ntf] and so on.
Public Types | |
| enum | EStatVal { kOK = 0, kIllegal, kNomem, kToolong } |
Public Member Functions | |
| TRegexp (const char *re, Bool_t wildcard=kFALSE) | |
| TRegexp (const TString &re) | |
| Create a regular expression from a TString. More... | |
| TRegexp (const TRegexp &re) | |
| Copy ctor. More... | |
| virtual | ~TRegexp () |
| Destructor. More... | |
| TRegexp & | operator= (const TRegexp &re) |
| Assignment operator. More... | |
| TRegexp & | operator= (const TString &re) |
| Assignment operator taking a TString. More... | |
| TRegexp & | operator= (const char *re) |
| Assignment operator taking a char* and assigning it to a regexp. More... | |
| Ssiz_t | Index (const TString &str, Ssiz_t *len, Ssiz_t start=0) const |
| Find the first occurrence of the regexp in string and return the position, or -1 if there is no match. More... | |
| EStatVal | Status () |
| Check status of regexp. More... | |
Private Member Functions | |
| void | CopyPattern (const TRegexp &re) |
| Copy the regular expression pattern. More... | |
| void | GenPattern (const char *re) |
| Generate the regular expression pattern. More... | |
| const char * | MakeWildcard (const char *re) |
| This routine transforms a wildcarding regular expression into a general regular expression used for pattern matching. More... | |
Private Attributes | |
| Pattern_t * | fPattern |
| EStatVal | fStat |
Static Private Attributes | |
| static const unsigned | fgMaxpat = 2048 |
#include <TRegexp.h>
| enum TRegexp::EStatVal |
| TRegexp::TRegexp | ( | const TString & | re | ) |
Create a regular expression from a TString.
Definition at line 61 of file TRegexp.cxx.
| TRegexp::TRegexp | ( | const TRegexp & | re | ) |
Copy ctor.
Definition at line 69 of file TRegexp.cxx.
|
virtual |
Destructor.
Definition at line 77 of file TRegexp.cxx.
Copy the regular expression pattern.
Definition at line 127 of file TRegexp.cxx.
Referenced by operator=(), and TRegexp().
|
private |
Generate the regular expression pattern.
Definition at line 117 of file TRegexp.cxx.
Referenced by operator=(), and TRegexp().
Find the first occurrence of the regexp in string and return the position, or -1 if there is no match.
Len is length of the matched string and i is the offset at which the matching should start.
Definition at line 208 of file TRegexp.cxx.
Referenced by TAuthenticate::CheckHost(), TSystem::CompileMacro(), TMLPAnalyzer::GatherInformations(), TString::Index(), RooStats::HistFactory::HistFactoryNavigation::SetConstant(), and TNeuron::UseBranch().
|
private |
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 and "?"'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".
Definition at line 144 of file TRegexp.cxx.
Assignment operator.
Definition at line 85 of file TRegexp.cxx.
Assignment operator taking a TString.
Definition at line 107 of file TRegexp.cxx.
| TRegexp & TRegexp::operator= | ( | const char * | re | ) |
Assignment operator taking a char* and assigning it to a regexp.
Definition at line 97 of file TRegexp.cxx.
| TRegexp::EStatVal TRegexp::Status | ( | ) |
Check status of regexp.
Definition at line 230 of file TRegexp.cxx.
Referenced by RooMapCatEntry::ok(), and RooMappedCategory::Entry::ok().
|
staticprivate |
Definition at line 43 of file TRegexp.h.
Referenced by CopyPattern(), GenPattern(), and MakeWildcard().
|
private |
Definition at line 41 of file TRegexp.h.
Referenced by CopyPattern(), GenPattern(), Index(), operator=(), and ~TRegexp().
|
private |
Definition at line 42 of file TRegexp.h.
Referenced by CopyPattern(), GenPattern(), Index(), and Status().