From: Jochem van Dieten [mailto:[EMAIL PROTECTED]
Sent: Saturday, January 03, 2004 2:42 PM
To: CF-Talk
Subject: Re: OT: Regular _expression_
Kevin Marino wrote:
>
> "Information","scheduler-0","12/29/03","15:41:19",,"Mail: 'Report Examines
> U.S. Long-Term Care Spending' From:'John Noone <[EMAIL PROTECTED]>'
> To:'[EMAIL PROTECTED]' was successfully sent using 192.168.5.186"
> "Information","mailWorker-3","12/29/03","15:56:34",,"Mail: 'FDA Sounds
Alarm
> Over Hospital Bed Fires' From:'[EMAIL PROTECTED]'
To:'[EMAIL PROTECTED]'
> was successfully sent using 192.168.5.186"
>
> The RegEx line I am using is;
>
> <cfset FromEmailPos =
>
ReFindNoCase("(From:')?[.]*[<]?([EMAIL PROTECTED](\.[\w_]+)+)",Message,1,True)
>
> The I can get the From Email from both lines, but believe this is
definitely
> not an optimal RegEx for the "From" part. Anybody have suggestions as to
how
> to improve.
> First, treat the log file as a Chr(13) delimited list, that will
> break the log into individual messages. Then, if you only use
> canonical email addresses, it should be as simple as:
> <cfset from = REReplaceNoCase(line, "^.*From:'([^']*)'.*$","\1")>
> Jochem
Jochem,
that helps, I now get "John Noone <[EMAIL PROTECTED]>" but I also need to
extract the actual email address from between the "<>" also they are
optional.
Thanks
Kevin
[Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings]

