title: Any tool/utility to rewrite URLs in an html page
body: <p>I am beginning to use lua especially with nginx. I need to rewrite the URLs <em>within</em> the html page i.e. let's say <code>&lt;a href="http://toberewritten.com"&gt;link1&lt;/a&gt;</code> should be rewritten to  <code>&lt;a href="http://rewritten.com"&gt;link1&lt;/a&gt;</code></p>
  
  <p>The lua html parser at  <a href="https://github.com/wscherphof/lua-htmlparser" rel="nofollow">https://github.com/wscherphof/lua-htmlparser</a> provides the URL but as far as I understand from its documentation, it will not rewrite the URL. I can perhaps reconstruct the page but was wondering if there is already a tool that would do that</p>
  
  <p>Thanks for any inputs</p>