Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Regular expressions
Message
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:
01224424
Vues:
11
>Anyone using regular expressions in VFP? I've tried the FFC regular expression, but it wouldn't work. Next I tried Craig Boyd's fll and it didn't work either (probably because I am using vfp 9).

We're using regular expressions to validate and extract email addresses
* ValidateEmailAddress
LPARAMETERS tcEmailAddr
LOCAL loRegExp
loRegExp = CreateObject("VBScript.RegExp")
loRegExp.IgnoreCase = .T.
loRegExp.Pattern =  '(\w[-._\w]*\w@\w[-._\w]*\w\.\w{2,9})'
RETURN loRegExp.Test(tcEmailAddr)

* ExtractAddresses(tcFromAddr)
LPARAMETERS tcEmailAddr
LOCAL loRegExp, loEmAddrList
loRegExp = CreateObject("VBScript.RegExp")
loRegExp.IgnoreCase = .T.
loRegExp.Pattern =  '(\w[-._\w]*\w@\w[-._\w]*\w\.\w{2,9})'
loEmAddrList = loRegExp.Execute(tcEmailAddr)
RETURN loEmAddrList
--sb--
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform