Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Regular expressions
Message
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Environment versions
Visual FoxPro:
VFP 9 SP1
OS:
Vista
Network:
Windows 2000 Server
Database:
MS SQL Server
Miscellaneous
Thread ID:
01224420
Message ID:
01224424
Views:
12
>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--
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform