Python regular expression to extract part of string content
typecho
typecho 2017-06-12 09:27:14
0
2
705
样本:user<user@test.com>
如何提取其中的 user@test.com 部分?

Ask, how to optimally implement regular expression in Python?

typecho
typecho

Following the voice in heart.

reply all(2)
Peter_Zhu
import re

str = 'user<user@test.com>'
print re.search('<(.+)>', str).group(1)
伊谢尔伦
# coding: utf8
import re
string = 'user<user@test.com>'
print re.findall(r'<([^>]+)', string)
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!