Groovy web console

subscribe to the feed Subscribe
to this
site

CURL_Output

Published 1 month ago by Chintan with tags CURL
Actions Execute script  ▶ Edit in console Back to console Show/hide line numbers View recent scripts
def s = """define contact 
            { 
                name IGI  
                alias Liberty 
            } 
            define contact
            { 
                name IGI1 
                alias Liberty1 
            }""";
def output = [:];
def matches = s.findAll(/(?<=name).*/);
def matches1 = s.findAll(/(?<=alias).*/);
for (i=0; i<matches.size; i++) 
{ 
    output.put(matches[i].trim(), matches1[i].trim()) 
} 
println(output);