Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Finding an email address
Message
 
 
To
29/07/2009 08:06:50
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Environment versions
Visual FoxPro:
VFP 9 SP2
Miscellaneous
Thread ID:
01415275
Message ID:
01415285
Views:
106
This message has been marked as a message which has helped to the initial question of the thread.
It tells the parser to return all matches, not the first one only.

If WSH is not an option, you can use Craig's FLL from http://www.sweetpotatosoftware.com/SPSBlog/2006/01/14/RegularExpressionsForVisualFoxProPart3.aspx
lcText = "somebody@something.com     abc@sajkfhe.com"

SET LIBRARY TO regexp.fll
lcPattern =  '([a-zA-Z\d][-._\w]*@\w[-._\w]*\w\.\w{2,4})'
DIMENSION laEmAddrList[1]

lnMatches = regexp(lcText, lcPattern, 2, "laEmAddrList")

FOR i=1 TO lnMatches 
	? laEmAddrList[i]
ENDFOR
>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
>
--sb--
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform