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: Kevin Ballard <kevin at sb dot org>
Date: Wed, 27 Feb 2002 18:49:38 -0500
On 2/27/02 6:40 PM, "Thomas Reed" <thomasareed at earthlink dot net> wrote:

> First, it doesn't handle line breaks well.  For example, suppose there's
> a break like this:
> 
> ............................... SRC =
> "somelink.html" ...

Ooh, with my RegEx 
(<[^>]*(SRC|HREF|BACKGROUND)=(\x22[^\x22]*\x22|[^\x20>])[^>]*>) I didn't
think about spaces around = and newlines. Try this modification (assuming my
RegEx works)

<[^>]*(SRC|HREF|BACKGROUND)\x22?\n?=\x22?\n?(\x22[^\x22]*\x22|[^\x20>])[^>]*
>

Assuming the original expression works (since it's untested), this new one
would allow spaces around the = and a newline at the =. It will also match
newlines before and after the SRC="link" part, seeing as it uses [^>] which
matches anything except ">".

-- 
Kevin Ballard
kevin at sb dot org
Email from Korea or China must go to <kevin dot nb at sb dot org>
http://kevin.sb.org/



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