Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Search in a text file
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Versions des environnements
Visual FoxPro:
VFP 9 SP2
OS:
Windows 7
Network:
Windows 2003 Server
Database:
MS SQL Server
Divers
Thread ID:
01520080
Message ID:
01520098
Vues:
61
>>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
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform