150 TTHREAD_TLS_ARRAY(
char,
fgMaxpat,buf);
153 int len = strlen(re);
158 for (
int i = 0; i <
len; i++) {
159 if ((
unsigned)slen >
fgMaxpat - 10) {
160 Error(
"MakeWildcard",
"regexp too large");
163 if (i == 0 && re[i] !=
'^') {
170 const char *wc =
"[^/]";
173 const char *wc =
"[^\\/:]";
186 const char *wc =
"[^/]";
189 const char *wc =
"[^\\/:]";
198 if (i ==
len-1 && re[i] !=
'$') {
216 Error(
"TRegexp::Index",
"Bad Regular Expression");
219 const char* s =
string.Data();
220 Ssiz_t slen =
string.Length();
221 if (slen < i)
return kNPOS;
224 *
len = endp - startp;
258 return r.Index(*
this, &
len, start);
269 return r.Index(*
this, extent, start);
319 if (len <= 0 || from > (
len - 1) || from < 0)
324 if(rdelim.
Length() == 1) {
325 rdelim =
"[" + rdelim +
"]+";
334 if (pos ==
kNPOS || pos > from) {
336 tok = (*this)(from, last-from+1);
350 from = (from <
len) ? from :
len;
int Makepat(const char *, Pattern_t *, int)
Make a pattern template from the string pointed to by exp.
const char * Matchs(const char *, size_t len, const Pattern_t *, const char **)
Match a string with a pattern.
void Error(const char *location, const char *msgfmt,...)
Use this function in case an error occurred.
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t r
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t Int_t Int_t Window_t TString Int_t GCValues_t GetPrimarySelectionOwner GetDisplay GetScreen GetColormap GetNativeEvent const char const char dpyName wid window const char font_name cursor keysym reg const char only_if_exist regb h Point_t winding char text const char depth char const char Int_t count const char ColorStruct_t color const char Pixmap_t Pixmap_t PictureAttributes_t attr const char char ret_data h unsigned char height h Atom_t Int_t ULong_t ULong_t unsigned char prop_list Atom_t Atom_t Atom_t Time_t UChar_t len
Regular expression class.
EStatVal Status()
Check status of regexp.
void CopyPattern(const TRegexp &re)
Copy the regular expression pattern.
static const unsigned fgMaxpat
virtual ~TRegexp()
Destructor.
TRegexp & operator=(const TRegexp &re)
Assignment operator.
const char * MakeWildcard(const char *re)
This routine transforms a wildcarding regular expression into a general regular expression used for p...
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...
TRegexp(const char *re, Bool_t wildcard=kFALSE)
Create a regular expression from the input string.
void GenPattern(const char *re)
Generate the regular expression pattern.
char & operator()(Ssiz_t i)
static constexpr Ssiz_t kNPOS
const char * Data() const
TObjArray * Tokenize(const TString &delim) const
This function is used to isolate sequential tokens in a TString.
Ssiz_t Index(const char *pat, Ssiz_t i=0, ECaseCompare cmp=kExact) const
A zero length substring is legal.