Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Regular expressions
Message
 
 
À
11/05/2007 06:54:15
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:
01224506
Vues:
11
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