Hi Rich,

Many thanks!! Worked like a charm!

Cheers
David


-----Original Message-----
From: Rich Wild [mailto:[EMAIL PROTECTED]] 
Sent: 05 July 2002 16:50
To: CF-Talk
Subject: RE: Regex help


try this (watch out for e-mail wrapping):

<cfsavecontent variable="content">
This is some <a href="test.cfm" class="class">test</a> text.

I just <b>want</b> the <a class="link"
href="http://www.site.com/hyperlinks.cfm";>hyperlinks</a> from it.

<br>That includes this <a href="one.htm">one</a>. </cfsavecontent>

<cfscript>
linksarr = arraynew(1);
pos = 1;
linkpos = refindnocase("<a[^<]*</a>", content, pos, "true"); while
(linkpos.len[1]) {
        arrayappend(linksarr, mid(content, linkpos.pos[1],
linkpos.len[1]));
        pos = linkpos.pos[1]+1;
        linkpos = refindnocase("<a[^<]*</a>", content, pos, "true");
}
</cfscript>

<cfdump var="#linksarr#">

> -----Original Message-----
> From: David Siew [mailto:[EMAIL PROTECTED]]
> Sent: 05 July 2002 09:22
> To: CF-Talk
> Subject: Regex help
> 
> 
> Hi all,
> 
> How can I strip a cfhttp.filecontent to obtain all the hyperlinks and 
> put them say into an array? Have been at it for the past 2 days and 
> still could not get it! Any advise will be much appreciated.
> 
> Thank you and regards
> David
> 
> 
> 

______________________________________________________________________
Get the mailserver that powers this list at http://www.coolfusion.com
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