[thelist] [ColdFusion] Regular Expression Questions

Tobyn Baugher toby at rsux.com
Mon Feb 24 22:30:02 CST 2003

Beam's response matches roughly what I would use for your first problem.

On Monday, February 24, 2003 3:10 PM -0800 ".jeff"
<jeff at members.evolt.org> wrote:

> so, next question is how to find relative and root relative links in
> the document.  obviously, '<a href="(\/?[^"]+)' is far too general.

I think you can get away with this:

<a href="([^:"]+)"

All absolute URLs have colons in them between the protocol and the rest
of the URL AFAIK (https?:, ftp:, mailto:), and so a URL that is lacking
them would be relative.

Of course, I haven't slept in quite a while, so feel free to point out
all the obvious cases I've missed :).



Tobyn Baugher <toby at rsux.com>
aim: dieplzkthxbye  icq: 14281524  efnet: toby

More information about the thelist mailing list