53 GenPattern(MakeWildcard(re));
146 TTHREAD_TLS_ARRAY(
char,
fgMaxpat,buf);
149 int len = strlen(re);
154 for (
int i = 0; i < len; i++) {
155 if ((
unsigned)slen >
fgMaxpat - 10) {
156 Error(
"MakeWildcard",
"regexp too large");
159 if (i == 0 && re[i] !=
'^') {
166 const char *wc =
"[^/]";
169 const char *wc =
"[^\\/:]";
182 const char *wc =
"[^/]";
185 const char *wc =
"[^\\/:]";
194 if (i == len-1 && re[i] !=
'$') {
211 Error(
"TRegexp::Index",
"Bad Regular Expression");
214 const char* s =
string.Data();
215 Ssiz_t slen =
string.Length();
216 if (slen < i)
return kNPOS;
219 *len = endp - startp;
252 return r.
Index(*
this, &len, start);
262 return r.
Index(*
this, extent, start);
311 if (len <= 0 || from > (len - 1) || from < 0)
321 if (pos ==
kNPOS || pos > from) {
323 tok = (*this)(from, last-from+1);
337 from = (from < len) ? from : len;
A zero length substring is legal.
TRegexp(const char *re, Bool_t wildcard=kFALSE)
TRegexp & operator=(const TRegexp &re)
Assignment operator.
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...
Regular expression class.
void GenPattern(const char *re)
Generate the regular expression pattern.
const char * Data() const
int Makepat(const char *, Pattern_t *, int)
Make a pattern template from the string pointed to by exp.
void Error(const char *location, const char *msgfmt,...)
char & operator()(Ssiz_t i)
const char * MakeWildcard(const char *re)
This routine transforms a wildcarding regular expression into a general regular expression used for p...
const char * Matchs(const char *, size_t len, const Pattern_t *, const char **)
Match a string with a pattern.
TObjArray * Tokenize(const TString &delim) const
This function is used to isolate sequential tokens in a TString.
static const Ssiz_t kNPOS
void CopyPattern(const TRegexp &re)
Copy the regular expression pattern.
virtual ~TRegexp()
Destructor.
ClassImp(TRegexp) TRegexp
Create a regular expression from the input string.
EStatVal Status()
Check status of regexp.
Ssiz_t Index(const char *pat, Ssiz_t i=0, ECaseCompare cmp=kExact) const
static const unsigned fgMaxpat