Reputation: 6226
I have a build in Jenkins triggered by Gerrit I would like to trigger on all branches except master
. What regex should I use for this?
Upvotes: 16
Views: 16250
Reputation: 31
The following worked for me:
^(master.+|(?!master).*)$
This excludes master only. Not master_joda, for example.
It is also based on these answers.
Upvotes: 3
Reputation: 1132
Using a negative lookahead worked for me:
^(?!.*master).*$
Should trigger on everything except master. Kudos to this questions answers.
Upvotes: 30