擅长:python、mysql、java
<p>这是使用<code>re</code>模块的解决方案:</p>
<pre><code>#!/usr/bin/env python
import re
open('output.html', 'w').write(re.sub('href="http://en.wikipedia.org', 'href="/home/fergus/wikiget/wiki/Absinthe', open('file.html').read()))
</code></pre>
<p>这是另一个没有使用<code>re</code>的方法:</p>
^{pr2}$