Frank ChengCode:Use Windows Use FlexCom20.pkg #IF !@<201 External_Function GetTickCount "GetTickCount" KERNEL32.DLL Returns DWORD #ENDIF Object oRegularExpression is a cComAutomationObject Set psProgID to "{3F4DACA4-160D-11D2-A8E9-00104B365C9F}" Procedure Set ComGlobal Boolean value Handle hDispatchDriver Get phDispatchDriver to hDispatchDriver Send PrepareParams to hDispatchDriver 1 Set ComProperty of hDispatchDriver 10003 OLE_VT_BOOL to value End_Procedure // ComGlobal Procedure Set ComPattern String value Handle hDispatchDriver Get phDispatchDriver to hDispatchDriver Send PrepareParams to hDispatchDriver 1 Set ComProperty of hDispatchDriver 10001 OLE_VT_BSTR to value End_Procedure // ComPattern Function ComExecute String llsourceString Returns Variant Handle hDispatchDriver Variant retVal Get phDispatchDriver to hDispatchDriver Send PrepareParams to hDispatchDriver 1 Send DefineParam to hDispatchDriver OLE_VT_BSTR llsourceString Get InvokeComMethod of hDispatchDriver 10004 OLE_VT_DISPATCH to retVal Function_Return retVal End_Function // ComExecute End_Object // oRegularExpression Object oMatchCollection is a cComAutomationObject Function ComItem Integer llindex Returns Variant Handle hDispatchDriver Variant retVal Get phDispatchDriver to hDispatchDriver Send PrepareParams to hDispatchDriver 1 Send DefineParam to hDispatchDriver OLE_VT_I4 llindex Get InvokeComMethod of hDispatchDriver 0 OLE_VT_DISPATCH to retVal Function_Return retVal End_Function // ComItem Function ComCount Returns Integer Handle hDispatchDriver Integer retVal Get phDispatchDriver to hDispatchDriver Get InvokeComMethod of hDispatchDriver 1 OLE_VT_I4 to retVal Function_Return retVal End_Function // ComCount End_Object // oMatchCollection Object oMatch is a cComAutomationObject Function ComValue Returns String Handle hDispatchDriver String retVal Get phDispatchDriver to hDispatchDriver Get InvokeComMethod of hDispatchDriver 0 OLE_VT_BSTR to retVal Function_Return retVal End_Function // ComValue End_Object // oMatch Procedure Test DWORD dwBegin dwEnd String sData String[] MyData Variant vMatchCollection vMatch Integer iItem iItems #IF !@<201 Set_Argument_Size 1000000 #ENDIF Move (Repeat("hello;", 50000)) to sData Send CreateComObject of oRegularExpression Move (GetTickCount()) to dwBegin Set ComGlobal of oRegularExpression to True Set ComPattern of oRegularExpression to '((\w|\d|\s)+)(?=;|$)' Get ComExecute of oRegularExpression sData to vMatchCollection Set pvComObject of oMatchCollection to vMatchCollection Get ComCount of oMatchCollection to iItems If (iItems > 0) Begin Move (ResizeArray (MyData, iItems)) to MyData Decrement iItems For iItem from 0 to iItems Get ComItem of oMatchCollection iItem to vMatch Set pvComObject of oMatch to vMatch Get ComValue of oMatch to MyData[iItem] Loop End Move (GetTickCount()) to dwEnd Showln "Time " (dwEnd - dwBegin) InKey FieldIndex End_Procedure // Test Send Test