class TPMERegexp: protected TPRegexp


TPRegexp

C++ Wrapper for the "Perl Compatible Regular Expressions" library
The PCRE lib can be found at:
http://www.pcre.org/

Extensive documentation about Regular expressions in Perl can be
found at :
http://perldoc.perl.org/perlre.html


Function Members (Methods)

public:
TPMERegexp()
TPMERegexp(const TPMERegexp& r)
TPMERegexp(const TString& s, const TString& opts = "", Int_t nMatchMax = 10)
TPMERegexp(const TString& s, UInt_t opts, Int_t nMatchMax = 10)
virtual~TPMERegexp()
static TClass*Class()
Int_tGetNMaxMatches() const
virtual TClass*IsA() const
Int_tMatch(const TString& s, UInt_t start = 0)
Int_tNMatches() const
TPMERegexp&operator=(const TPMERegexp&)
TStringoperator[](Int_t)
virtual voidPrint(Option_t* option = "")
voidResetGlobalState()
voidSetNMaxMatches(Int_t nm)
virtual voidShowMembers(TMemberInspector& insp, char* parent)
Int_tSplit(const TString& s, Int_t maxfields = 0)
virtual voidStreamer(TBuffer& b)
voidStreamerNVirtual(TBuffer& b)
TStringSubstitute(const TString& s, const TString& r, Bool_t doDollarSubst = kTRUE)
protected:
voidTPRegexp::Compile()
TStringTPRegexp::GetModifiers() const
TStringTPRegexp::GetPattern() const
Bool_tTPRegexp::MatchB(const TString& s, const TString& mods = "", Int_t start = 0, Int_t nMaxMatch = 10)
Int_tTPRegexp::MatchInternal(const TString& s, Int_t start, Int_t nMaxMatch, TArrayI* pos = 0)
TObjArray*TPRegexp::MatchS(const TString& s, const TString& mods = "", Int_t start = 0, Int_t nMaxMatch = 10)
voidTPRegexp::Optimize()
UInt_tTPRegexp::ParseMods(const TString& mods) const
Int_tTPRegexp::ReplaceSubs(const TString& s, TString& final, const TString& replacePattern, Int_t* ovec, Int_t nmatch) const
Int_tTPRegexp::SubstituteInternal(TString& s, const TString& replace, Int_t start, Int_t nMaxMatch0, Bool_t doDollarSubst)

Data Members

protected:
enum TPRegexp::[unnamed] { kPCRE_GLOBAL
kPCRE_OPTIMIZE
kPCRE_DEBUG_MSGS
kPCRE_INTMASK
};
protected:
void*fAddressOfLastStringused for checking for change of TString in global match
Int_tfLastGlobalPositionend of last match when kPCRE_GLOBAL is set
TStringfLastStringMatchedcopy of the last TString matched
TArrayIfMarkerslast set of indexes of matches
Int_tfNMatchesnumber of matches returned from last pcre_exec call
Int_tfNMaxMatchesmaximum number of matches
UInt_tTPRegexp::fPCREOpts
TStringTPRegexp::fPattern
PCREPriv_t*TPRegexp::fPriv

Class Charts

Inheritance Inherited Members Includes Libraries
Class Charts

Function documentation

TPMERegexp(const TPMERegexp& r)
 Default constructor. This regexp will match an empty string.
TPMERegexp(const TString& s, const TString& opts, Int_t nMatchMax)
 Constructor:
  s    - string to compile into regular expression
  opts - perl-style character flags to be set on TPME object
TPMERegexp(const TString& s, UInt_t opts, Int_t nMatchMax)
 Constructor:
  s    - string to copmile into regular expression
  opts - PCRE-style option flags to be set on TPME object
TPMERegexp(const TPMERegexp& r)
 Copy constructor.
 Only PCRE specifics are copied, not last-match or global-matech
 information.
void ResetGlobalState()
 Reset state of global match.
 This happens automatically when a new string is passed for matching.
Int_t Match(const TString& s, UInt_t start = 0)
 Runs a match on s against the regex 'this' was created with.

 Args:
  s        - string to match against
  offset   - offset at which to start matching
 Returns:  - number of matches found
Int_t Split(const TString& s, Int_t maxfields = 0)
 Splits into at most maxfields. If maxfields is unspecified or
 0, trailing empty matches are discarded. If maxfields is
 positive, no more than maxfields fields will be returned and
 trailing empty matches are preserved. If maxfields is empty,
 all fields (including trailing empty ones) are returned. This
 *should* be the same as the perl behaviour.

 If pattern produces sub-matches, these are also stored in
 the result.

 A pattern matching the null string will split the value of EXPR
 into separate characters at each point it matches that way.

 Args:
  s         - string to split
  maxfields - maximum number of fields to be split out.  0 means
              split all fields, but discard any trailing empty bits.
              Negative means split all fields and keep trailing empty bits.
              Positive means keep up to N fields including any empty fields
              less than N. Anything remaining is in the last field.
 Returns:   - number of fields found
TString Substitute(const TString& s, const TString& r, Bool_t doDollarSubst = kTRUE)
 Substitute matching part of s with r, dollar back-ref
 substitution is performed if doDollarSubst is true (default).

 After the substitution, another pass is made over the resulting
 string and the following special tokens are interpreted:
 \l - lowercase next char,
 \u - uppercase next char,
 \L - lowercase till \E,
 \U - uppercase till \E, and
 \E - end case modification.
TString operator[](Int_t )
 Returns the sub-string from the internal fMarkers vector.
 Requires having run match or split first.
void Print(Option_t* option = "")
 Print the regular expression and modifier options.
 If 'option' contains "all", prints also last string match and
 match results.
TPRegexp & operator=(const TPMERegexp& )
virtual ~TPMERegexp()
{}
Int_t GetNMaxMatches()
{ return fNMaxMatches; }
void SetNMaxMatches(Int_t nm)
{ fNMaxMatches = nm; }
Int_t NMatches()
{ return fNMatches; }

Author: Eddy Offermann 24/06/05
Last change: root/base:$Id: TPRegexp.h 23681 2008-05-07 14:36:58Z rdm $
Last generated: 2008-06-25 08:50
Copyright (C) 1995-2005, Rene Brun and Fons Rademakers. *

This page has been automatically generated. If you have any comments or suggestions about the page layout send a mail to ROOT support, or contact the developers with any questions or problems regarding ROOT.