[英]How to extract d@u from 'From richard.richrdqwd@uct.za.ca' using non-greedy regular expression?
I'm quite new to regular expressions in Python.我对 Python 中的正则表达式很陌生。
So I'm wondering how can I extract d@u
from the text below using non-greedy expressions?所以我想知道如何使用非贪婪表达式从下面的文本中提取d@u
?
x = 'From richard.richrdqwd@uct.za.ca'
Thank you in advance!先感谢您!
Any suggestion would be appreciated任何建议将不胜感激
Try this:尝试这个:
import re
m = re.search('.@.', 'From richard.richrdqwd@uct.za.ca')
if m:
print(m.group(0))
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.