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

Support String.eachMatch, String.findAll in Pipeline

    • Icon: Improvement Improvement
    • Resolution: Fixed
    • Icon: Minor Minor
    • workflow-cps-plugin
    • None

      I'd like the ability to iterate over regex matches against a string.

      Thus far my attempts at using eachMatch and findAll have both met a similar end:

       

      00:04:43.237 Got exception: org.jenkinsci.plugins.scriptsecurity.sandbox.RejectedAccessException: Scripts not permitted to use staticMethod org.codehaus.groovy.runtime.DefaultGroovyMethods eachMatch java.lang.String java.lang.String groovy.lang.Closure [Pipeline] }

          [JENKINS-46358] Support String.eachMatch, String.findAll in Pipeline

          Sean Busbey created issue -

          Sean Busbey added a comment -

          if anyone has a workaround I can use in the mean time I'd really appreciate it.

          Sean Busbey added a comment - if anyone has a workaround I can use in the mean time I'd really appreciate it.
          Andrew Bayer made changes -
          Assignee New: Andrew Bayer [ abayer ]
          Andrew Bayer made changes -
          Status Original: Open [ 1 ] New: In Progress [ 3 ]
          Andrew Bayer made changes -
          Status Original: In Progress [ 3 ] New: In Review [ 10005 ]

          Andrew Bayer added a comment -

          Initial PR up at https://github.com/cloudbees/groovy-cps/pull/70 - still need to do the downstream workflow-cps PR to go with it.

          Andrew Bayer added a comment - Initial PR up at https://github.com/cloudbees/groovy-cps/pull/70 - still need to do the downstream workflow-cps PR to go with it.
          Andrew Bayer made changes -
          Remote Link New: This issue links to "groovy-cps PR #70 (Web Link)" [ 17504 ]

          Andrew Bayer added a comment -

          Also adding script security PR for whitelisting.

          Andrew Bayer added a comment - Also adding script security PR for whitelisting.
          Andrew Bayer made changes -
          Remote Link New: This issue links to "script-security PR #145 (Web Link)" [ 17505 ]

          Andrew Bayer added a comment -

          And downstream PR in workflow-cps up at https://github.com/jenkinsci/workflow-cps-plugin/pull/168

          Andrew Bayer added a comment - And downstream PR in workflow-cps up at https://github.com/jenkinsci/workflow-cps-plugin/pull/168
          Andrew Bayer made changes -
          Remote Link New: This issue links to "workflow-cps PR #168 (Web Link)" [ 17506 ]

            abayer Andrew Bayer
            busbey Sean Busbey
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: