This question was caused by a typo or a problem that can no longer be reproduced. While similar questions may be on-topic here, this one was resolved in a way less likely to help future readers.
Closed 4 months ago.
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
接受
或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
发布评论
评论(3)
您需要转义模式内每一次出现的分隔符:
所以逃避它:
顺便说一句:目前
.*
中的 量词是贪婪的,这意味着它将尽可能匹配。您可能想像以前一样使用?
将其更改为非贪婪变体。You need to escape every occurrence of the delimiter inside the pattern:
So escape it:
By the way: Currently the quantifier in
.*
is greedy, that means it will match as much as possible. You might want to change it to an ungreedy variant using?
like you did before.您需要一个分隔符,如果您实际上在表达式中使用它,则需要转义它(即:
[/attachment]
有一个/ 中)。转义它或更改分隔符(例如
#
)。You need a delimeter, and you need to escape it if you're actually using it in your expression (i.e.:
[/attachment]
has a/
in it). Escape it or change your delimiter (#
for example).我想我解决了这个问题。我在示例中的测试数据很糟糕,因此我尝试匹配无效的模式。
I think I solve this. My test data in the example was bad, so I was trying to match an invalid pattern.