【发布时间】:2018-08-08 14:23:51
【问题描述】:
RT @Complex: 'Atlanta' Season 2 director: "If the first season is College Dropout, this one is Late Registration."
@pastorjnelson Pastor JN, I have spoken to you before. But, lol, you didnt know who I was. Or maybe, I didnt know2026
假设我有两个如上所示的字符串。我想使用 Python 正则表达式从给定行 @____ 中获取特定的字符串模式。我怎样才能做到这一点? 第一个字符串的预期输出应该是@Complex,第二个字符串应该是@pastorjnelson。
【问题讨论】:
-
re.findall(r'@\S+', text)