擅长:python、mysql、java
<p><code>filterSub()</code>应该调用<code>re.sub()</code>并返回结果。您还需要在正则表达式中转义<code>.</code>,因为它有特殊的含义。并使用<code>$</code>锚点,以便只在域名的末尾匹配它。在</p>
<pre><code>def filterSub(fullList2):
return re.sub(r'example\.com$', 'sub.example.com', fullList2)
</code></pre>