>>o_regexp1=NEWOBJECT("_regexp","c:\program files (x86)\microsoft visual foxpro 9\ffc\_regexp.vcx") >>o_regexp1.Pattern = "%[^.]VFP2SQL%" >>lnOcc = o_regexp1.Execute(FILETOSTR(GETFILE()), .t.) && .t. -> Case sensitive >>DISP MEMO LIKE o_regexp1.matches >>>
*** This is the code from Execute methond of _regexpr class tcStr = FILETOSTR(GETFILE()) loRegEx = CreateObject("VBScript.RegExp") loRegEx.pattern = "[^.]VFP2SQL" loRegEx.ignoreCase = .t. loRegEx.global = .t. loMatches = loRegEx.execute(" "+tcStr) && Just in case the file starts with the string Dimension matches[Max(loMatches.count,1),2] taMatchInfo = .F. i = 1 For Each loMatch In loMatches matches[i, 1] = loMatch.firstIndex && fox strings are not zero-based, but because the first space you shouldn't add anything :-) matches[i, 2] = loMatch.value i = i + 1 EndFor loMatches = .F. loRegEx = .F. Return i -1