Bryan,

If you want to strip all email addresses like below, use this:

REReplaceNoCase(str,"<[EMAIL PROTECTED],}>?","","all")

If you want to extract the email address:

REReplaceNoCase(str,"^.*([EMAIL PROTECTED],}).*$","\1")

Pascal

> -----Original Message-----
> From: Bryan F. Hogan [mailto:[EMAIL PROTECTED]
> Sent: donderdag 10 juni 2004 19:00
> To: CF-Talk
> Subject: Re: Reliably stripping out only the email address?
>
> Hi Mike it works on all but the last index.
>
> Thanks for the script.
>
> Mike Townend wrote:
> > <CFSCRIPT>
> > function ExtractEmail(sString)
> > {
> >     return trim(ReReplace(sString, ".*<([^>]*)>.*", "\1")); }
> > </CFSCRIPT> <CFSET lstEmails =
> '[EMAIL PROTECTED],<[EMAIL PROTECTED]>,DisplayName
> > <[EMAIL PROTECTED]>,"DisplayName" <[EMAIL PROTECTED]>,[EMAIL PROTECTED]
> (DisplayName)'>
> >
> > <CFLOOP LIST="#lstEmails#" INDEX="idxFoo">
> >     <CFOUTPUT>#ExtractEmail(idxFoo)#</CFOUTPUT><BR>
> > </CFLOOP>
[Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings]

Reply via email to