library: libCore #include "TPRegexp.h" |
TPRegexp
class description - header file - source file
viewCVS header - viewCVS source
class TPRegexp
Function Members (Methods)
Display options:
public:
| TPRegexp() |
| TPRegexp(const TString& pat) |
| TPRegexp(const TPRegexp& p) |
virtual | ~TPRegexp() |
static TClass* | Class() |
virtual TClass* | IsA() const |
Int_t | Match(const TString& s, const TString& mods = , Int_t offset = 0, Int_t nMatchMax = 30, TArrayI* pos = 0) |
Bool_t | MatchB(const TString& s, const TString& mods = , Int_t offset = 0, Int_t nMaxMatch = 30) |
TObjArray* | MatchS(const TString& s, const TString& mods = , Int_t offset = 0, Int_t nMaxMatch = 30) |
TPRegexp& | operator=(const TPRegexp& p) |
virtual void | ShowMembers(TMemberInspector& insp, char* parent) |
virtual void | Streamer(TBuffer& b) |
void | StreamerNVirtual(TBuffer& b) |
Int_t | Substitute(TString& s, const TString& replace, const TString& mods = , Int_t offset = 0, Int_t nMatchMax = 30) |
Data Members
public:
enum { | kPCRE_GLOBAL | |
| kPCRE_OPTIMIZE | |
| kPCRE_DEBUG_MSGS | |
| kPCRE_INTMASK | |
}; | | |
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
void Optimize()
Send the pattern through the optimizer.
Int_t Match(const TString &s, const TString &mods, Int_t start, Int_t nMaxMatch, TArrayI *pos)
The number of matches is returned, this equals the full match +
sub-pattern matches.
nMaxmatch is the maximum allowed number of matches.
pos contains the string indices of the matches. Its usage is
shown in the routine MatchS.
Int_t Substitute(TString &s, const TString &replacePattern, const TString &mods, Int_t start, Int_t nMaxMatch)
Substitute replaces the string s by a new string in which matching
patterns are replaced by the replacePattern string. The number of
substitutions are returned.
TString s("aap noot mies");
const Int_t nrSub = TPRegexp("(\\w*) noot (\\w*)").Substitute(s,"$2 noot $1");
cout << nrSub << " \"" << s << "\"" <<endl;
produces: 2 "mies noot aap"
Author: Eddy Offermann 24/06/05
Last update: root/base:$Name: $:$Id: TPRegexp.cxx,v 1.1 2005/12/02 16:17:48 rdm Exp $
Copyright (C) 1995-2005, Rene Brun and Fons Rademakers. *
ROOT page - Class index - Class Hierarchy - Top of the page
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.