• Icon: Improvement Improvement
    • Resolution: Unresolved
    • Icon: Major Major
    • core
    • Windows 7

      The Job naming pattern is working for simple pattern, however I am unable to include conditional regex (if) in the pattern

      (_)?(?(1)[\w]{1,15} )

      . Meaning _ is a optional string, if found then a string of length 1 to 15 should be available. Also, I would need to set similar Node naming pattern as we are having more nodes

          [JENKINS-28912] CLONE - Job and Node naming convention

          Daniel Beck added a comment -

          This is not a valid Java regular expression, and the error message tells you so.

          If you disagree, please provide sample code for the script console in Jenkins that shows that your regular expression is valid and matches according to your expectations.

          Daniel Beck added a comment - This is not a valid Java regular expression, and the error message tells you so. If you disagree, please provide sample code for the script console in Jenkins that shows that your regular expression is valid and matches according to your expectations.

          Sagayaraj David added a comment - - edited

          It appears that by default java.util.regex.Pattern class does not support conditional regex. But it is possible with JRegex. Please check http://stackoverflow.com/questions/3687921/conditional-regular-expression-in-java for clarification.

          Also, at present only Job naming standard enforcement is available. Similarly Node naming needs to be enforced

          Sagayaraj David added a comment - - edited It appears that by default java.util.regex.Pattern class does not support conditional regex. But it is possible with JRegex. Please check http://stackoverflow.com/questions/3687921/conditional-regular-expression-in-java for clarification. Also, at present only Job naming standard enforcement is available. Similarly Node naming needs to be enforced

          Is there any update here? I also think View Name also can be standardized with pattern

          Sagayaraj David added a comment - Is there any update here? I also think View Name also can be standardized with pattern

            Unassigned Unassigned
            sagayd Sagayaraj David
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated: