gpt4 book ai didi

.net - 模拟所有格量词

转载 作者:行者123 更新时间:2023-12-03 15:19:46 25 4
gpt4 key购买 nike

是否可以使用原子分组(或以其他方式)模拟所有格量词(.NET 不支持)?

笔记。我发现 (x+x+)++y可以换成(?>(x+x+)+)y ,但这只是一个例子,我不知道是否总是{something}@+等于 (?>{something}@) (其中 @ 是一个量词)。

最佳答案

是的。我可以引用大师本人杰弗里·弗里德尔 (Jeffrey Friedl) 的经典著作 Mastering Regular Expressions (3rd Edition) 第 142 页的内容吗? :

"In one sense, possessive quantifiers are just syntactic sugar, as they can be mimicked with atomic grouping. Something like .++ has exactly the same result as (?>.+), although a smart implementation can optimize possessive quantifiers more than atomic grouping."

关于.net - 模拟所有格量词,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5537513/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com