Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Regular expressions
Message
 
 
À
11/05/2007 08:23:41
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Versions des environnements
Visual FoxPro:
VFP 9 SP1
OS:
Vista
Network:
Windows 2000 Server
Database:
MS SQL Server
Divers
Thread ID:
01224420
Message ID:
01224519
Vues:
18
Are you running code from my last message where Global = .T. ?

>Interesting. One more question: On my machine the count is 1. What can cause that?
>
>>It's collection of match objects. The Global = .T. setting is requred if all matches are desired. The rest of details about match object you can find using Intellisense.
>>BTW, in the code I'm using one of regular expressions from http://regexlib.com/.
>>
>>CLEAR
>>
>>TEXT TO lcStr NOSHOW
>>Sales: sales@whatever.com
>>Info: info@whatever.com
>>Support: support@whatever.com
>>ENDTEXT
>>
>>
>>loMatches = ExtractAddresses(lcStr)
>>? loMatches.Count
>>FOR EACH loMatch IN loMatches
>>	? loMatch.Value
>>ENDFOR
>>RETURN
>>
>>FUNCTION ExtractAddresses
>>LPARAMETERS tcText
>>LOCAL loRegExp, loEmAddrList
>>loRegExp = CreateObject("VBScript.RegExp")
>>loRegExp.IgnoreCase = .T.
>>loRegExp.Global = .T.
>>loRegExp.Pattern =  '(\w[-._\w]*\w@\w[-._\w]*\w\.\w{2,9})'
>>loEmAddrList = loRegExp.Execute(tcText)
>>RETURN loEmAddrList
>>
>>
>>>Just curiousity, what properties does loEmAddrList have?
>>>
--sb--
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform