Details
-
Improvement
-
Status: Closed (View Workflow)
-
Minor
-
Resolution: Fixed
-
None
-
1.596.1
Description
I want to create a delivery pipeline view for just the jobs under a folder (using the cloudbees-folders plugin).
In attempting to use the regex match, it appears that the folder name is not part of the string being matched.
I can get everything (including those jobs I do not want) using ^(.+)$, so I know that regex filtering works. But when I try things like
- ^foldername/(.+)$
- ^foldername\/(.+)$
Then the view is completely empty.
The jobs in the folder do not have a consistent naming structure such that I can match against just those jobs.
Is there any way do this with this plugin?
Attachments
Issue Links
- is related to
-
JENKINS-27539 NPE when using jobs with the same name in different folders
-
- Closed
-
@James: You can either match() or find() a regexp to/in a String. `match()` returns only true if the whole string is matched by the regexp. `find()` on the other hand matches if there is any substring inside the string matching the regexp. You can convert a valid match()-regexp into a find()-regexp by anchoring it in ^ and $, and vice versa by putting '.*' behind and after the regexp (for single line strings, multiline would be a bit more complicated).
The code in the plugin uses find(), therefore you have to convert the find()-regexp into a match() regexp by anchoring, as you did. Personally, I think match() would have been the 'nicer' solution, but to change that now would break compatibility with previous versions.
So, continue to anchor your regexps (but for the record, you should also append '$').