且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

为什么此正则表达式会返回错误?

更新时间:2022-05-20 22:37:50

您可以检查

You might check your pcre.backtrack_limit setting. It would have to be ridiculously low to prevent that regex from matching that input, but you did say you'd been messing around with the setup...

您可以尝试通过更改正则表达式来对其进行测试.当我在RegexBuddy中对其进行测试时,您的正则表达式将在1216步中匹配该输入.当我将其更改为此:

You can try testing it by changing the regex. When I tested it in RegexBuddy, your regex matched that input in 1216 steps. When I changed it to this:

'%<tr.*?>.*?<b>.*?</b>[^<]*(?:<(?!/?tr\b)[^<]*)*</tr>%ims'

...只走了441步.

...it only took 441 steps.