Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Search in a text file
Message
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Environment versions
Visual FoxPro:
VFP 9 SP2
OS:
Windows 7
Network:
Windows 2003 Server
Database:
MS SQL Server
Miscellaneous
Thread ID:
01520080
Message ID:
01520091
Views:
60
This message has been marked as a message which has helped to the initial question of the thread.
>>
>>
>>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 doesn't seem to work.

I just test it :-)
Here one tested (not much)) version:
*** 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
Against Stupidity the Gods themselves Contend in Vain - Johann Christoph Friedrich von Schiller
The only thing normal about database guys is their tables.
Previous
Reply
Map
View

Click here to load this message in the networking platform