Exclude Jenkins Jobs from Regular Expression View

We use regular expressions to include assignments in our representations for Jenkins. Currently, the regex for "example" -view is example_(.+) .

However, we just added a new project called "example_example2", and now tasks from this project are also displayed in the "example" view. Is there a regex to exclude "example_example2" -jobs from "example" -view? I am trying to use ^ , but have not succeeded.

Could you help me?

+2
source share
1 answer

You can match example_ , not followed by example2 , and then end the line using a negative view:

 example_(?!example2$)(.+) ^^^^^^^^^^^^^ 

If you need to bind a pattern, add ^ at the beginning. .+ will match any 1 or more characters other than line break characters to the end of the line.

Watch the demo version of regex online .

+3
source

Source: https://habr.com/ru/post/1237042/


All Articles