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:
01520099
Vues:
68
This message has been marked as a message which has helped to the initial question of the thread.
>>>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?

It depends of:
loRegExp.IgnoreCase = .t.             && case insensitive
loRegExp.IgnoreCase = .f.             && case sensitive
Against Stupidity the Gods themselves Contend in Vain - Johann Christoph Friedrich von Schiller
The only thing normal about database guys is their tables.
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform