I had some time to nail something down.... Try this:

<cfsavecontent variable="Test">
        > On Wednesday 19 April 2006 04:31, Rey Bango wrote:
        > 
        >>something, I'd like to see if there's something already built to 
        >>handle
        >>this:
        >> ><[EMAIL PROTECTED]>:
        >> >This user doesn't have a yahoo.com account
([EMAIL PROTECTED]) 
        >> >[0]
        > 
        > 
        > You mean like a regular expression, wrapped in a simple loop over
each line ?
        > 
</cfsavecontent>

<!--- Create a patter. --->
<cfset jobjPattern = CreateObject("java",
"java.util.regex.Pattern").Compile( "(?<=\()([EMAIL PROTECTED])(?=\))" ) />

<!--- Get the matcher for the patter. --->
<cfset jobjMatcher = jobjPattern.Matcher( Test ) />

<!--- Create an array to store emails. --->
<cfset arrEmails = ArrayNew(1) />

<!--- Loop while we have matches. --->
<cfloop condition="#jobjMatcher.Find()#">
        
        <!--- Get the email. --->
        <cfset ArrayAppend( arrEmails, jobjMatcher.Group() ) />

</cfloop>

<cfdump var="#arrEmails#" /> 


.......................
Ben Nadel 
Web Developer
Nylon Technology
350 7th Ave.
Suite 1005
New York, NY 10001
212.691.1134 x 14
212.691.3477 fax
www.nylontechnology.com

Sanders: Lightspeed too slow?
Helmet: Yes we'll have to go right to ludacris speed.
-----Original Message-----
From: Thomas Chiverton [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, April 19, 2006 10:32 AM
To: CF-Talk
Subject: Re: Extract email(s) from non-delivered message

On Wednesday 19 April 2006 15:20, Rey Bango wrote:
> Sure. Got something like that? ;)

Ben Nadel suggest a reg. ex. yesterday.

-- 

Tom Chiverton
Advanced ColdFusion Programmer



~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Message: http://www.houseoffusion.com/lists.cfm/link=i:4:238096
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54

Reply via email to