Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Finding an email address
Message
De
29/07/2009 08:06:50
 
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Versions des environnements
Visual FoxPro:
VFP 9 SP2
Divers
Thread ID:
01415275
Message ID:
01415284
Vues:
96
Thanks Sergey! What does the loRegExp.Global = .T. setting do?



>Hi Jos,
>
>The best way is using regular expressions
>
>lcText = "somebody@something.com     abc@sajkfhe.com"
>loRegExp = CreateObject("VBScript.RegExp")
>loRegExp.Global = .T.
>loRegExp.Pattern =  '([a-zA-Z\d][-._\w]*@\w[-._\w]*\w\.\w{2,4})'
>loEmAddrList = loRegExp.Execute(lcText)
>
>FOR EACH  loAddr IN loEmAddrList
>	? loAddr.Value
>ENDFOR
>>
>>I am looking for the fastest way to find an email address within a block of text of variable length and unknown layout. Any suggestions for quickest/easiest solution? I know I can use AT() to look for an "@" char but is there any clever trick to getting the address quickly?
>>
>>Thanks,
In the End, we will remember not the words of our enemies, but the silence of our friends - Martin Luther King, Jr.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform