Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-46143

Support for negative look behind / ahead expressions

XMLWordPrintable

    • Icon: Improvement Improvement
    • Resolution: Not A Defect
    • Icon: Minor Minor
    • role-strategy-plugin
    • None
    • Jenkins LTS v2.60.2
      Role Strategy Plugin 2.5.1

      My use case is that I'd like to exclude one folder while allowing all others without having to explicitly name every allowed folder, for which the general approach seems to be something on the order of:

      https://stackoverflow.com/questions/2107989/matching-all-words-except-one/2108007#2108007

      \w+\b(?<!\bboy)
      
      (?!boy\b)\b\w+
      

      https://stackoverflow.com/questions/2078915/a-regular-expression-to-exclude-a-word-string/2078953#2078953

      ^/(?!ignoreme|ignoreme2|ignoremeN)([a-z0-9]+)$ 
      

      I've tried numerous variations on these that all pass in regex testers, but none work in the role strategy plugin, in all cases the user can either see no jobs or all (mostly none).

      I've not much experience with either type of expression, so I could be making a mistake, but I've tested variations on them to the best of my ability on third-party tools.

            Unassigned Unassigned
            philmcardlecg Phil McArdle
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: