54 GenPattern(MakeWildcard(re));
147 TTHREAD_TLS_ARRAY(
char,
fgMaxpat,buf);
150 int len = strlen(re);
155 for (
int i = 0; i < len; i++) {
156 if ((
unsigned)slen >
fgMaxpat - 10) {
157 Error(
"MakeWildcard",
"regexp too large");
160 if (i == 0 && re[i] !=
'^') {
167 const char *wc =
"[^/]";
170 const char *wc =
"[^\\/:]";
183 const char *wc =
"[^/]";
186 const char *wc =
"[^\\/:]";
195 if (i == len-1 && re[i] !=
'$') {
212 Error(
"TRegexp::Index",
"Bad Regular Expression");
215 const char* s =
string.Data();
216 Ssiz_t slen =
string.Length();
217 if (slen < i)
return kNPOS;
220 *len = endp - startp;
253 return r.
Index(*
this, &len, start);
263 return r.
Index(*
this, extent, start);
311 Int_t len = Length();
312 if (len <= 0 || from > (len - 1) || from < 0)
317 if(rdelim.
Length() == 1) {
318 rdelim =
"[" + rdelim +
"]+";
327 if (pos ==
kNPOS || pos > from) {
329 tok = (*this)(from, last-from+1);
343 from = (from < len) ? from : len;
A zero length substring is legal.
TRegexp(const char *re, Bool_t wildcard=kFALSE)
Create a regular expression from the input string.
TRegexp & operator=(const TRegexp &re)
Assignment operator.
Regular expression class.
Ssiz_t Index(const char *pat, Ssiz_t i=0, ECaseCompare cmp=kExact) const
void GenPattern(const char *re)
Generate the regular expression pattern.
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.
void CopyPattern(const TRegexp &re)
Copy the regular expression pattern.
virtual ~TRegexp()
Destructor.
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...
EStatVal Status()
Check status of regexp.
static const unsigned fgMaxpat
const char * Data() const