What is the Groovy equivalent of the following Perl code?
my $txt = \"abc : groovy : def\"; if ($txt =~ / : (.+?) : /) { my $match = $1; print \"MATCH=$m
This is my best understanding of how to do this using Groovy syntax (but see lfaraone's response too):
import java.util.regex.Matcher def txt = 'abc : groovy : def' if (txt =~ ~/ : (.+?) : /) { def match = Matcher.lastMatcher[0][1] println "MATCH=$match" }