val text
= "irrelevant part[identifier]key1=val1;key2=val2;key3=val3" val regex
= """(?:\G(?!^);|\[identifier])([\w-]+)=([^;]*)""".
r val results
= (regex findAllIn text
).
matchData.
map(x
=> (x.
group(1), x.
group(2))).
toMap println(results)
}
b2JqZWN0IE1haW4gZXh0ZW5kcyBBcHAgewoJdmFsIHRleHQgPSAiaXJyZWxldmFudCBwYXJ0W2lkZW50aWZpZXJda2V5MT12YWwxO2tleTI9dmFsMjtrZXkzPXZhbDMiCgl2YWwgcmVnZXggPSAiIiIoPzpcRyg/IV4pO3xcW2lkZW50aWZpZXJdKShbXHctXSspPShbXjtdKikiIiIucgoJdmFsIHJlc3VsdHMgPSAocmVnZXggZmluZEFsbEluIHRleHQpLm1hdGNoRGF0YS5tYXAoeCA9PiAoeC5ncm91cCgxKSwgeC5ncm91cCgyKSkpLnRvTWFwCglwcmludGxuKHJlc3VsdHMpCn0=