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);
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;
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.