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 20:47:10 -0500
On 2/27/02 8:38 PM, "Jerry Hamlet" <jerry at hamletzone dot com> wrote:

> What's the special notation "" about? I'm not familiar with that.

Seeing as the RegEx searchpattern is a string, it has to be enclosed in
quotes ("). This means if you want the quote character in your string, you
can't simply type a quote ("). REALbasic solved the problem of how to type a
quote in a string by making it so if you have two quotes ("") in a string,
it turns into one quote and is part of the string. So two quotes ("") is
identical to \x20 in the RegEx, but is slightly easier to read.

Oh, and I know [^>]* is greedy. But the greediness makes it go faster, no?
It just grabs all characters up until the first >. That doesn't seem like it
would take too long to do. But for the link itself, I decided not to stop at
the first ">" because of reasons previously stated (but only when the link
is enclosed in quotes).

-- 
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>