Regex Tutorial: http://www.pjnetsolutions.com/index.cfm?fuseaction=articles.main
And just for you (!) a ready made regex function to validate email addresses: http://www.pjnetsolutions.com/regex/isvalidemail.func.version.1.1.txt This checks whether an email address is valid and doesn't return where one would be in a block of text... You can use the Regex (pls include copyright) to do a REFind in a block of text, it's not much different. Instead of using the ^ and the $ for the start and end of the regex, remove them and it will find the start of each occurrence of any email address in a block of text! I'm sure you could figure the rest out! HTH Paul > -----Original Message----- > From: Allan Cliff [mailto:[EMAIL PROTECTED] > Sent: 20 June 2003 08:59 > To: CF - List > Subject: [ cf-dev ] Get an email address out of a block of text > > > What I am trying to do is the following. > > Every so often we send out tens of thousands of emails and a > few thousand of these come back either as invalid mail > address, full mailbox or incorrect syntax of email. > > So what I want to do is schedule cfpop to take these off the > server and then look in the body of these emails and get the > culprit out. Then mark them in the database so they have to > enter a correct mail address. > > So how would I go about getting the email address out of the > following example. Also bear in mind that every mail host > sends a different kind of mail so the text block will always > be different. > > ---------------------------------------------------------------------- > Reporting-MTA: Arrival-Date: Fri, 20 Jun 2003 02:01:01 +0000 (GMT) > > Final-Recipient: rfc822; [EMAIL PROTECTED] > Action: failed > Status: 5.0.0 > Diagnostic-Code: X-Postfix; host > abcdef.whitehouse.com[65.39.178.33] said: 554 > <[EMAIL PROTECTED]>: Recipient address rejected: Account > expired------------------------------------------------------- > --------------- > -- ** Archive: http://www.mail-archive.com/dev%40lists.cfdeveloper.co.uk/ To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] For human help, e-mail: [EMAIL PROTECTED]
