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:
01224506
Views:
15
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--
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform