Brian, this should do the trick.

<cfscript>
variables.titleStart = FindNoCase("<title>", cfhttp.filecontent) + 7;
variables.titleEnd = FindNoCase("</title>", cfhttp.filecontent);

variables.title = Mid(cfhttp.filecontent, variables.titleStart,
(variables.titleEnd - variables.titleStart));

writeoutput("Title = #variables.title#");
</cfscript>


 hth, Craig

-----Original Message-----
From: Brian Hasselback [mailto:[EMAIL PROTECTED]]
Sent: 10 August 2001 14:50
To: CF-Talk
Subject: RE: Trimming Source Code


Sorry, I wasnt to clear on what I was trying to accomplish. I want the code
between the <TITLE>*</TITLE> and not everything else.

Thanks.
Brian

-----Original Message-----
From: Jochem van Dieten [mailto:[EMAIL PROTECTED]]
Sent: Friday, August 10, 2001 9:41 AM
To: CF-Talk
Subject: Re: Trimming Source Code


Brian Hasselback wrote:

> I am retrieving the source code from a document using the CFHTTP GET
> command. What I would like to do is Trim the returned Source Code to trim
> out the TITLE of the document for output. I am new at ColdFusion and would
> much appreciate any help you may provide.


<cfset title =
REReplaceNoCase(cfhttp.filecontent,"<title>([^<])*</title>","\1")>

Jochem
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

Reply via email to