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:
01520098
Views:
62
>>Sure, RegExpr should be much easier. Wondering if someone can help here, as I am swamped at the moment.
>>
>>BTW, this is how occurrence is spelled.
>
>Something like this (no local declaration nor error testing etc)
>
>
>clear
>loRegExp = CREATEOBJ('VBScript.RegExp')
>loRegExp.Global = .t.                 && translate all occurances
>loRegExp.IgnoreCase = .t.             && case insensitive
>loRegExp.Pattern = '[^\.]VFP2SQL'
>lcContents	= FILETOSTR({Your File})
>loMatches	= loRegExp.Execute(lcContents)
>? 'Found ', loMatches.Count, 'matches'
>IF loMatches.Count > 0
>	FOR lnMatch = 0 TO loMatches.Count - 1
>		loMatch	= loMatches.Item(lnMatch)
>		? CHR(9) + 'Match ' + TRANSFORM(lnMatch) + ': "' + loMatch.Value + '" at position ' + TRANSFORM(loMatch.FirstIndex)
>	NEXT lnMatch
>endif	
>
Thanks, Hugo and Boris. I've tested it, it seems to work. Is it case sensitive or case-insensitive?
If it's not broken, fix it until it is.


My Blog
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform