regex - Jenkins - 排除的提交消息正则表达式不起作用

标签 regex jenkins continuous-integration

在 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+/

enter image description here


但该作业仍在触发构建。

有谁知道我的 REGEX 是否不好,或者 Jenkins 是否需要一些我不知道的 REGEX 特殊语法?

谢谢

杰夫

最佳答案

您需要先删除正则表达式分隔符。

然后,应该对点进行转义,因为它是一个特殊的正则表达式字符,表示除了换行符之外的任何符号

因此,您需要使用

Rebasing with the integration commit that was just made in rev\.\d+

关于regex - Jenkins - 排除的提交消息正则表达式不起作用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32748816/

相关文章:

php - Jenkins 和 PHP 项目的 Jenkins 作业模板

svn - 持续集成颠覆

regex - Powershell正则表达式在替换期间显示变量名称而不是其值

regex - perl 中的 split 函数应该如何工作?

javascript - 从 Jenkins 下载 zip

android - 如何使用 bitbucket-pipelines 定位 apk 文件?

regex - 使用 sed 打印每个匹配模式的第一行出现次数

Java正则表达式匹配无回车符后跟换行符

jenkins - 如何根据个别测试结果在Jenkins管道作业中设置slackSend?

Jenkins 管道清除工作区