Python中文
首页
教程
问答
标签
搜索
登录
注册
从emai主体中提取域
回答此问题可获得
20
贡献值,回答如果被采纳可获得
50
分。
<p>我想知道是否有任何方法可以从python中的电子邮件正文中提取域名。我想用正则表达式,但我写得不太好,想知道是否有人能帮我。以下是电子邮件正文示例:</p> <pre><code><tr><td colspan="5"><font face="verdana" size="4" color="#999999"><b>Resource Links - </b></font><span class="snv"><a href="http://clk.about.com/?zi=4/RZ">Get Listed Here</a></span></td><td class="snv" valign="bottom" align="right"><a href="http://sprinks.about.com/faq/index.htm">What Is This?</a></td></tr><tr><td colspan="6" bgcolor="#999999"><img height="1" width="1"></td></tr><tr><td colspan="6"><map name="sgmap"><area href="http://x.about.com/sg/r/3412.htm?p=0&amp;ref=fooddrinksl_sg" shape="rect" coords="0, 0, 600, 20"><area href="http://x.about.com/sg/r/3412.htm?p=1&amp;ref=fooddrinksl_sg" shape="rect" coords="0, 55, 600, 75"><area href="http://x.about.com/sg/r/3412.htm?p=2&amp;ref=fooddrinksl_sg" shape="rect" coords="0, 110, 600, 130"></map><img border="0" src="http://z.about.com/sg/sg.gif?cuni=3412" usemap="#sgmap" width="600" height="160"></td></tr><tr><td colspan="6">&nbsp;</td></tr> <tr><td colspan="6"><a name="d"><font face="verdana" size="4" color="#cc0000"><b>Top Picks - </b></font></a><a href="http://slclk.about.com/?zi=1/BAO" class="srvb">Fun Gift Ideas</a><span class="snv"> from your <a href="http://chinesefood.about.com">Chinese Cuisine</a> Guide</span></td></tr><tr><td colspan="6" bgcolor="cc0000"><img height="1" width="1"></td></tr><tr><td colspan="6" class="snv"> </code></pre> <p>所以我需要“clk.about.com网站“等等</p> <p>谢谢!在</p>
0 条评论
分类:
Python问答
请先
登录
后评论
默认排序
时间排序
1 个回答
匿名
1天前
擅长:python、mysql、java
<p>HTMLParser是一种干净的方法。如果你想要快速而肮脏的东西,或者只是想看看一个中等复杂的正则表达式是什么样子的,这里有一个正则表达式示例可以找到href's(从我头顶上下来,没有经过测试):</p> <pre><code>r'<a\s+href="\w+://[^/"]+[^"]*">' </code></pre>
请先
登录
后评论
针对此问题:
更多的回答
关注
89
关注
收藏
1
收藏,
216
浏览
网友 提问于 2天前
相关Python问题
VirtualEnvRapper错误:路径python2(来自python=python2)不存在
7 回答
virtualenvs上的pyinstaller,没有名为导入错误的模块
9 回答
virtualenvs是否可以退回到用户包而不是系统包?
8 回答
virtualenvwrapper CentOS7
6 回答
virtualenvwrapper IOError:[Errno 13]权限被拒绝
2 回答
virtualenvwrapper mkproject和shell在windows中的启动问题?
4 回答
virtualenvwrapper mkvirtualenv不工作但没有错误
8 回答
Virtualenvwrapper python bash
4 回答
virtualenvwrapper:“workon”何时更改到项目目录?
2 回答
virtualenvwrapper:mkvirtualenv可以工作,但是rmvirtualenv返回bash:没有这样的文件或目录
8 回答
virtualenvwrapper:virtualenv信息存储在哪里?
3 回答
virtualenvwrapper:命令“python设置.pyegg_info“失败,错误代码为1
1 回答
virtualenvwrapper:如何将mkvirtualenv的默认Python版本/路径更改为ins
1 回答
Virtualenvwrapper:模块“pkg_resources”没有属性“iter_entry_points”
4 回答
Virtualenvwrapper:没有名为virtualenvwrapp的模块
1 回答
Virtualenvwrapper.bash_profi的正确设置
2 回答
Virtualenvwrapper.hook:权限被拒绝
2 回答
virtualenvwrapper.sh:fork:资源暂时不可用Python/Djang
5 回答
Virtualenvwrapper.shlssitepackages命令不工作
7 回答
Virtualenvwrapper.sh函数在bash sh中不可用
10 回答