This is a regex I'm using in a recent app that I wrote: <cfset re = '^(("[\w-\s]+")|([\w-]+(?:\.[\w-]+)*)|("[\w-\s]+")([\w-]+(?:\.[\w-]+)*))(@(( ?:[\w-]+\.)*\w[\w-]{0,66})\.([a-z]{2,6}(?:\.[a-z]{2})?)$)|(@\[?((25[0-5]\.|2 [0-4][0-9]\.|1[0-9]{2}\.|[0-9]{1,2}\.))((25[0-5]|2[0-4][0-9]|1[0-9]{2}|[0-9] {1,2})\.){2}(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[0-9]{1,2})\]?$)'>
This one is specifically Javascript, but I'd be willing to bet that it would translate straight up. Andy -----Original Message----- From: Mike Francisco [mailto:[EMAIL PROTECTED] Sent: Thursday, September 25, 2008 3:59 PM To: cf-talk Subject: RE: OT- Regex Help- extracting email address Adrian, No it might not always be the format- possibly it might just be the email address only or one with brackets. > -----Original Message----- > From: Adrian Lynch [mailto:[EMAIL PROTECTED] > Sent: Thursday, September 25, 2008 1:49 PM > To: cf-talk > Subject: RE: OT- Regex Help- extracting email address > > If that's always the format, no need for a RegEx, use > ListLast(theString, " > "). > > Adrian > > -----Original Message----- > From: Mike Francisco > Sent: 25 September 2008 21:32 > To: cf-talk > Subject: OT- Regex Help- extracting email address > > Hello CFers, > > I know this is OT, but I'll ask anyway. I was wondering if someone can > help me with regex. > > I am returning a query object after executing a cfpop. On the query > object, there is a column named 'From'. The data string is formatted > like: "John > Doe" [EMAIL PROTECTED] . I would like to use regex to strip the data > string and just get the email address. > > Thanks in advance, everyone. > > mike > > > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~| Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to date Get the Free Trial http://ad.doubleclick.net/clk;207172674;29440083;f Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:313098 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4