为什么git-log后面带有perl regex负数会导致致命错误?

问题描述 投票:0回答:1

要么我无法获得git-log的regexp grep功能来使用基于perl的regexp(pcre)进行搜索,要么可以,但是它不能与否定的后向配合使用。

git log -p -P -G'(?<!-)title'

输出结果

fatal: invalid regex: Invalid preceding regular expression

但是,如果git-grep是任何指标,则pcre支持和负向后退似乎有效。例如。 git grep -P '(?<!-)title'返回预期结果。

git版本2.21.0(Apple Git-122.2)

regex git pcre git-log
1个回答
0
投票

-P不影响-G。您可以通过将-P替换为-F(或--fixed-string)来进行验证:即使固定字符串中根本没有环顾四周,您仍然会收到相同的错误。

© www.soinside.com 2019 - 2024. All rights reserved.