realbasic-nug
[Top] [All Lists]

Re: finding links with RegEx?

To: REALbasic Network Users Group <realbasic-nug at lists dot realsoftware dot com>
Subject: Re: finding links with RegEx?
From: Noah Desch <noahdesch at erols dot com>
Date: Wed, 27 Feb 2002 17:42:38 -0500

On Wednesday, February 27, 2002, at 05:35  PM, Thomas Reed wrote:

Does anyone have an example of how to find links in HTML files using
RegEx?  I'm not all that knowledgeable in regular expressions, and I'm
curious about whether someone else has already invented this particular
wheel...

Note that I need to find any kind of link to an external file -- such as
<A HREF="link">, <IMG SRC="link">, <BODY BACKGROUND="link">, etc.  And I
need to be able to quickly and easily isolate the "link" text.

I'm no expert but the search pattern would be something like

"SRC=""(.)"""

and

"HREF=""(.)"""

(sorry, I don't know how to search for both at the same time)
and then RegexMatch.Subexpression(1) would be the link URL.

-Noah Desch
Wireframe Software
http://wireframe.virtualave.net

"This could take thousands and thousands of nanoseconds... this might even take a whole SECOND!"
-ReBoot, the best cartoon ever.



<Prev in Thread] Current Thread [Next in Thread>