您好我正在阅读一些代码并发现re.compile("<@(U\S+)>")
,我在理解<>
方面遇到了一些麻烦。有人能给出一个匹配的例子吗?我曾尝试使用'<@U>'
或'<@jyx>'
的python交互式shell,但它们不匹配。感谢。
答案 0 :(得分:5)
<>
没有任何意义。
您必须提供<@U
然后1 or more non space characters
然后>
才能匹配。
像
<@UASD>
<@US>
您的输入
<@U> did not match as no non space character present after U
<@asd> did not match as no U present after @