在 Jenkins 中,我有一项工作,当发现以下提交消息时,我不想触发构建::
[REBASE] Rebasing with the integration commit that was just made in rev.123456789
提交消息中唯一改变的是字符串末尾的数字值。
为了阻止构建,我使用作业配置页面的“排除的提交消息”字段。在该字段中,我放置了以下正则表达式::
/Rebasing with the integration commit that was just made in rev.\d+/
但该作业仍在触发构建。
有谁知道我的 REGEX 是否不好,或者 Jenkins 是否需要一些我不知道的 REGEX 特殊语法?
谢谢
杰夫
最佳答案
您需要先删除正则表达式分隔符。
然后,应该对点进行转义,因为它是一个特殊的正则表达式字符,表示除了换行符之外的任何符号。
因此,您需要使用
Rebasing with the integration commit that was just made in rev\.\d+
关于regex - Jenkins - 排除的提交消息正则表达式不起作用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32748816/