Emacs正则表达式支持占有量词吗?

时间:2015-06-13 16:10:12

标签: regex emacs

参考this question,我发现它非常有趣。如果Emacs支持possessive quantifiers,则无法立即进行测试。支持延迟量词的manual says

  

?,+?,??是上面运算符的非贪婪变体。正常运算符'','+','?'尽可能匹配,只要整个正则表达式仍然可以匹配。使用以下“?”,它们将尽可能少地匹配......

但无法找到关于占有?+的任何内容,例如*+++ab

例如,在字符串.*+a|b.*a|b quantifiersLoading 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正则表达式支持占有量词吗?

1 个答案:

答案 0 :(得分:1)

不,Emacs不支持*+等。请参阅Elisp手册,节点Regexp Special