Name: Tatham Oddie
Date: 7/10/2004 3:51:07 AM
Dont mean to jump Anders, but this is a limited regex. I have just finished writing a link validator (http://www.ssw.com.au/ssw/linkauditor) and it turns out to be a lot more complex.
It doesn't handle nested links - which some fools try to do.
If you were trying to extract links from a page, for some form of auditing or crawling purpose, you would also need to handle the <base href="..."> tag, the assosciated HTTP header, or assosciated HTTP-Equiv META tag.
Title: Unusual, but migh appear
Name: Adi Rotaru
Date: 6/6/2004 4:16:04 AM
There are some (we could say) exceptional situations which you did not address in your regexp:
<a href=' http://www.yahoo.com '>YAHOO!</a>
notice the different VALID ways to specify URL. Don't forget that HTML is "blank-blind" :)
<a href=http://www.yahoo.com>YAHOO!</a >
<a href = http://www.yahoo.com>YAHOO!</a >
Hope to be helpful ;)
Now, get to work :))
Title: Using the pattern
Name: Anders Rask
Date: 12/10/2003 1:58:31 PM
the pattern contains parentheses that can be used in either test or (as in your case) replace. Depending on what language you code in, you can access the data inside the parentheses with properties.
hope this helps
Title: add target attribute to external urls
Name: Michael Iantosca
Date: 12/10/2003 12:35:50 PM
You mentioned you were going to use it to add targets to all external urls. This is exactly what I need but how would I use it to add a target attribute to all external urls?