参考this question,我发现它非常有趣。如果Emacs支持possessive quantifiers,则无法立即进行测试。支持延迟量词的manual says:
?,+?,??是上面运算符的非贪婪变体。正常运算符'','+','?'尽可能匹配,只要整个正则表达式仍然可以匹配。使用以下“?”,它们将尽可能少地匹配......
但无法找到关于占有?+
的任何内容,例如*+
,++
,ab
例如,在字符串.*+a|b
上
.*a|b
quantifiers但Loading composer repositories with package information
Updating dependencies (including require-dev)
Your requirements could not be resolved to an installable set of packages.
Problem 1
- Conclusion: don't install symfony/symfony v2.7.1
- don't install symfony/symfony v2.7.0|remove symfony/var-dumper v2.6.7
- don't install symfony/var-dumper v2.6.7|don't install symfony/symfony v2.7.0
- don't install symfony/symfony v2.7.0|don't install symfony/var-dumper v2.6.7
- Installation request for symfony/symfony 2.7.* -> satisfiable by symfony/symfony[v2.7.0, v2.7.1].
- Installation request for symfony/var-dumper == 2.6.7.0 -> satisfiable by symfony/var-dumper[v2.6.7].
would match b。
Emacs正则表达式支持占有量词吗?