40 kPCRE_GLOBAL = 0x80000000,
41 kPCRE_OPTIMIZE = 0x40000000,
42 kPCRE_DEBUG_MSGS = 0x20000000,
43 kPCRE_INTMASK = 0x0FFF
50 static Bool_t fgThrowAtCompileError;
54 UInt_t ParseMods(
const TString &mods)
const;
55 Int_t ReplaceSubs(
const TString &s, TString &
final,
56 const TString &replacePattern,
57 Int_t *ovec, Int_t nmatch)
const;
59 Int_t MatchInternal(
const TString& s, Int_t start,
60 Int_t nMaxMatch, TArrayI *pos=0)
const;
62 Int_t SubstituteInternal(TString &s,
const TString &replace,
63 Int_t start, Int_t nMaxMatch0,
64 Bool_t doDollarSubst)
const;
68 TPRegexp(
const TString &pat);
69 TPRegexp(
const TPRegexp &p);
72 Bool_t IsValid()
const;
74 Int_t Match(
const TString &s,
const TString &mods=
"",
75 Int_t start=0, Int_t nMaxMatch=10, TArrayI *pos=0);
76 TObjArray *MatchS(
const TString &s,
const TString &mods=
"",
77 Int_t start=0, Int_t nMaxMatch=10);
78 Bool_t MatchB(
const TString &s,
const TString &mods=
"",
79 Int_t start=0, Int_t nMaxMatch=10) {
80 return (Match(s,mods,start,nMaxMatch) > 0); }
81 Int_t Substitute(TString &s,
const TString &replace,
82 const TString &mods=
"", Int_t start=0,
85 TString GetPattern()
const {
return fPattern; }
86 TString GetModifiers()
const;
88 TPRegexp &operator=(
const TPRegexp &p);
90 static Bool_t GetThrowAtCompileError();
91 static void SetThrowAtCompileError(Bool_t throwp);
97 class TPMERegexp :
protected TPRegexp {
100 TPMERegexp& operator=(
const TPMERegexp&);
107 TString fLastStringMatched;
108 void *fAddressOfLastString;
110 Int_t fLastGlobalPosition;
114 TPMERegexp(
const TString& s,
const TString& opts =
"", Int_t nMatchMax = 10);
115 TPMERegexp(
const TString& s, UInt_t opts, Int_t nMatchMax = 10);
116 TPMERegexp(
const TPMERegexp& r);
118 virtual ~TPMERegexp() {}
120 void Reset(
const TString& s,
const TString& opts =
"", Int_t nMatchMax = -1);
121 void Reset(
const TString& s, UInt_t opts, Int_t nMatchMax = -1);
123 Int_t GetNMaxMatches()
const {
return fNMaxMatches; }
124 void SetNMaxMatches(Int_t nm) { fNMaxMatches = nm; }
126 Int_t GetGlobalPosition()
const {
return fLastGlobalPosition; }
127 void AssignGlobalState(
const TPMERegexp& re);
128 void ResetGlobalState();
130 Int_t Match(
const TString& s, UInt_t start = 0);
131 Int_t Split(
const TString& s, Int_t maxfields = 0);
132 Int_t Substitute(TString& s,
const TString& r, Bool_t doDollarSubst=kTRUE);
134 Int_t NMatches()
const {
return fNMatches; }
135 TString operator[](Int_t);
137 virtual void Print(Option_t* option=
"");
139 ClassDef(TPMERegexp, 0);
143 class TStringToken :
public TString {
146 const TString fFullStr;
152 TStringToken(
const TString& fullStr,
const TString& splitRe, Bool_t retVoid=kFALSE);
153 virtual ~TStringToken() {}
156 Bool_t AtEnd()
const {
return fPos >= fFullStr.Length(); }
158 ClassDef(TStringToken,0)