扫码关注官方订阅号
样本:user<user@test.com> 如何提取其中的 user@test.com 部分?
问一下,用Python 正则如何最优实现?
Following the voice in heart.
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)
微信扫码关注PHP中文网服务号
QQ扫码加入技术交流群
扫描下载App
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号
PHP学习
技术支持
返回顶部
Following the voice in heart.