I'm working on writing an http tunnel kind of
servlet, and I need some help with url replacement.
I'm using a Map to translate from an alias to an address.
So, for the alias "blah" and the address "blah.com"
I want to replace all href links such that
<a href="http://blah.com/hello.html"> --> <a href="http://localhost/blah/hello.html">
OR
<a href="hello.html"> --> <a href="http://localhost/blah/hello.html">
Can someone help me out with a regex
pattern or patterns that will match
<a href=" +
http:// + aliasAddress OR
<a href=" + not
http:// I've got the pattern for the first one, the problem is the 2nd one.
[ September 23, 2003: Message edited by: Phil Chuang ]