15    static const char *underline =
 
   16       "----------------------------------------------------------------\n";
 
   22       printf(
"Global matching\n%s", underline);
 
   23       TPMERegexp re(
"ba[rz]", 
"g");
 
   24       TString m(
"foobarbaz");
 
   29       printf(
"Global matching with back-refs\n%s", underline);
 
   30       TPMERegexp re1(
"(ba[rz])", 
"g");
 
   31       TString m1(
"foobarbaz");
 
   36       printf(
"Matching with nested back-refs\n%s", underline);
 
   37       TPMERegexp re2(
"([\\w\\.-]+)@((\\d+)\\.(\\d+)\\.(\\d+)\\.(\\d+))");
 
   38       TString m2(
"matevz.tadel@137.138.170.210");
 
   48       printf(
"Split\n%s", underline);
 
   50       TString m(
"root:x:0:0:root:/root:/bin/bash");
 
   55       printf(
"Split with maxfields=5\n%s", underline);
 
   60       printf(
"Split with empty elements in the middle and at the end\n" 
   61              "maxfields=0, so trailing empty elements are dropped\n%s", underline);
 
   62       m = 
"root::0:0:root:/root::";
 
   67       printf(
"Split with empty elements at the beginning and end\n" 
   68              "maxfields=-1, so trailing empty elements are kept\n%s", underline);
 
   74       printf(
"Split with no pattern in string\n%s", underline);
 
   75       m = 
"A dummy line of text.";
 
   82       printf(
"Split with regexp potentially matching a null string \n%s", underline);
 
   84       TString m(
"hi there");
 
   91       printf(
"Split on patteren with back-refs\n%s", underline);
 
   92       TPMERegexp re(
"([,-])");
 
  103       printf(
"Substitute\n%s", underline);
 
  104       TPMERegexp re(
"(\\d+)\\.(\\d+)\\.(\\d+)\\.(\\d+)");
 
  105       TString m(
"137.138.170.210");
 
  106       TString r(
"$4.$3.$2.$1");
 
  107       TString s(m); re.Substitute(s, r);
 
  109       printf(
"Substitute '%s','%s' => '%s'\n", m.Data(), r.Data(), s.Data());
 
  114       printf(
"Global substitute\n%s", underline);
 
  115       TPMERegexp re(
"(\\w+)\\.(\\w+)@[\\w\\.-]+", 
"g");
 
  116       TString m(
"rene.brun@cern.ch, philippe.canal@fnal.gov, fons.rademakers@cern.ch");
 
  117       TString r(
"\\u$1 \\U$2\\E");
 
  118       TString s(m); re.Substitute(s, r);
 
  120       printf(
"Substitute '%s','%s' => '%s'\n", m.Data(), r.Data(), s.Data());