Groovy web console

subscribe to the feed Subscribe
to this
site
grouped regex (via #groovywebconsole)
tweet this snippet Tweet
this
script

grouped regex

Published 1 month ago by marcello.desales@gmail.com with tags regex groups
Actions  ➤ Edit in console Back to console Show/hide line numbers View recent scripts
def link = 'https://github.com/services-config/jenkins-shared-library.git/search?q=json&unscoped_q=json'
def matcher = link =~ /com\/(?<org>.+)\/(?<repo>.*).git/
if (matcher) {
println matcher.group("org")
println matcher.group("repo")
}