I want to replace all links on a HTML page with a defined URL and the original link in the query string.
Here is an example:
"http://www.ex.com abc http://www.anotherex.com"
Should be replaced by:
"http://www.newex.com?old=http://www.ex.com ABC http://www.newex.com?old=http://www.anotherex.com"
I thought about using replaceAll, but I dont know exactly how to reuse the regex pattern in the replacement.