I had to do this just recently.

<a href="">
\1 will be the href, and \2 will be the text between the tags.
This will work across linebreaks, if the regex engine does multiple lines.
I have no clue how CF handles backreferences, or multiple lines
though.

--
jon
mailto:[EMAIL PROTECTED]

Friday, September 26, 2003, 10:28:27 AM, you wrote:
KP> Hi All,
KP> I have to parse some complex links like

KP> <a href="" class="link_orange" >KP> >KP> g name="lpg2" src="" alt="Link Popularity
KP> Gauge" border="0" width="63"></a>

KP> or

KP> <a href="" class="link_white">Click here to find
KP> out</a>

KP> I need a CFSCRIPT to do that. I was successfully able to get the link using
KP> beow pated  cfscsipt. But Also I need is if it is a image link  then it
KP> should say Image Link - No Text else get the text means name of the link.
KP> <cfscript>
KP> function GetAnchor(str) {
KP>         var output = ArrayNew(1);
KP>         var i=1;
KP>         var start = 1;
KP>         var matchStruct ="";
KP>         while(1 eq 1){

KP> reFindNoCase("<[[:space:]]*a[[:space:]]*[^<]*href[[:space:]]*=[[:space:]]*""
KP> ([^<]*)""",str,start,1);
KP>                 if(arrayLen(matchStruct.len) lt 2) { return output; }
KP>                 output[i] = Mid(str,matchStruct.pos[2],matchStruct.len[2]);
KP>                 start = matchStruct.pos[2];
KP>                 i = i + 1;
KP>         }
KP> }
KP> </cfscript>


KP> Any help is appreciated. Thanks in advance.

KP> Ketan Patel
KP> G3 Technology Group, LLC
KP> Graphics III Advertising, Inc.
KP> (410)789-7007 or (800)783-1799
KP> "It's Not Creative if it doesn't Sell."
KP> http://www.g3group.com <http://www.g3group.com>


KP>
[Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings]

Reply via email to