Bryan,
Take a look at this as an example. Its rough and ready but works in all your
test cases....
<cfset teststring = '[EMAIL PROTECTED],<[EMAIL PROTECTED]>,DisplayName
<[EMAIL PROTECTED]>,"DisplayName" <[EMAIL PROTECTED]>,[EMAIL PROTECTED] (DisplayName)'>
<cfset startpos = 1>
<cfset foundall = false>
<cfloop condition="foundall IS false">
<cfset st1 =
ReFindNoCase("([^\x01-\x20\;\""\,])[EMAIL PROTECTED];\""\,]*(\.[a-zA-Z]{2,
})*", teststring, startpos, True)>
<cfif st1.pos[1] GT 0>
<cfoutput>#st1.pos[1]#; length is #st1.len[1]#
#ReplaceList(Mid(testString,st1.pos[1],st1.len[1]), "<,>",
"")#</cfoutput><br>
<cfflush>
<cfset startpos = st1.pos[1] + st1.len[1]>
<cfif startpos GT len(teststring)>
<cfset foundall = true>
</cfif>
<cfelse>
<cfset foundall = true>
</cfif>
</cfloop>
Paul
[Todays Threads]
[This Message]
[Subscription]
[Fast Unsubscribe]
[User Settings]
- Reliably stripping out only the email address? Bryan F. Hogan
- Re: Reliably stripping out only the email address? Mike Townend
- Re: Reliably stripping out only the email addres... Bryan F. Hogan
- Re: Reliably stripping out only the email ad... Mike Townend
- Re: Reliably stripping out only the emai... Bryan F. Hogan
- RE: Reliably stripping out only the... Paul Vernon
- RE: Reliably stripping out only the email address? Pascal Peters
- Re: Reliably stripping out only the email addres... Bryan F. Hogan
- Re: Reliably stripping out only the email ad... Thomas Chiverton
- Re: Reliably stripping out only the emai... Bryan F. Hogan
- RE: Reliably stripping out only the email address? Pascal Peters
- RE: Reliably stripping out only the email address? Pascal Peters