Chiefwarpaint
Chiefwarpaint

Reputation: 683

Jenkins - Excluded Commit Messages REGEX Not Working

In Jenkins, I have a job that I don't want to trigger a build for when the following commit message is found ::

[REBASE] Rebasing with the integration commit that was just made in rev.123456789

The only thing that changes in the commit message is the number value at the end of the string.

To prevent the build, I'm using the "Excluded Commit Messages" field of the job configuration page. In that field, I placed the following REGEX ::

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

enter image description here


but the job is still triggering a build.

Does anyone know if maybe my REGEX is bad, or if Jenkins requires some special syntax for REGEX's that I don't know about ?

Thanks,

Jeff

Upvotes: 2

Views: 899

Answers (1)

Wiktor Stribiżew
Wiktor Stribiżew

Reputation: 627087

You need to remove the regex delimiters first.

Then, a dot should be escaped as it is a special regex character meaning any symbol but a newline.

Thus, you need to use

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

Upvotes: 2

Related Questions