Try this:

<cfset l_text = "from: me
to: you
msg: Hello there
to:me
" />

<cfset l_index = REFindNoCase("to:.*?(?=[\r]?\n)",l_text,1,true) />

<cfset l_pos = l_index.pos[1] />
<cfset l_len = l_index.len[1] />

<cfset l_to = Mid(l_text,l_pos,l_len) />

<cfdump var="#l_to#" />



On 10/31/05, Dave Ashworth <[EMAIL PROTECTED]> wrote:
>
> I am using CFdirectory and CFfile to read the contents of a collection of
> ..msg files within a directory
>
> I wish to find the first instance of "To:" within the file and then return
> that whole line up to the Chr(10) at the end of the line so I can do some
> work with the address the msg was sent to
>
> is this done with regular expressions (which I know little about) or can
> this be done with a series of CF functions?
>
> Thanks
> Dave
>
>
> 

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Find out how CFTicket can increase your company's customer support 
efficiency by 100%
http://www.houseoffusion.com/banners/view.cfm?bannerid=49

Message: http://www.houseoffusion.com/lists.cfm/link=i:4:222711
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54

Reply via email to