http://xxx.xxxx.com
xxx.xxxx.com
xxxx.com
xxxx.me
xxxx.it
试了下,基本上都能匹配到了。
一对比,我现在用的这个简直弱爆了:
def replace_links(s):
return re.sub('(http://[^\s]+)', r'<a rel="nofollow" href="\1">' + r'\1' + '</a>', s, re.M)
求指点,求提高。
xxx.xxxx.com
xxxx.com
xxxx.me
xxxx.it
试了下,基本上都能匹配到了。
一对比,我现在用的这个简直弱爆了:
def replace_links(s):
return re.sub('(http://[^\s]+)', r'<a rel="nofollow" href="\1">' + r'\1' + '</a>', s, re.M)
求指点,求提高。