TRegEx 正则表达式

TRegEx 
#include <System.RegularExpressions.hpp>

void __fastcall TForm1::Button1Click(TObject *Sender)
{
  const String bigString = "Look for a the strings in this strang of strungs.";
  const String littlestring = "(str)([iau]ng)";
  TRegEx *regex;
  TGroupCollection mygrps;
 
  regex = new TRegEx(littlestring);
  mycoll = regex->Matches(bigString);
  Edit1->Text = "Count: " + IntToStr(mycoll.Count);
  Memo1->Lines->Add("First Collection: ");
  for (int i=0; i < mycoll.Count; i++)
  {
    Memo1->Lines->Add("Match #" + IntToStr(i) + ": " + mycoll.Item[i].Value);
    Memo1->Lines->Add("Group: " + IntToStr(i));
    mygrps = mycoll.Item[i].Groups;
    for (int j=0; j < mygrps.Count; j++)
      Memo1->Lines->Add("Value: " + mygrps.Item[j].Value);
  };
}

 sql server

 and dm  like '[0-9]%'

 and dm like '[A-z]%'

原文地址:https://www.cnblogs.com/cb168/p/4645474.html