*?
y +?
.
La siguiente sesión con groovysh
puede ayudarte:
groovy:000> m = "/*a*/ /*b*/" =~'(/\\*.*\\*/)' ===> java.util.regex.Matcher[pattern=(/\*.*\*/) region=0,11 lastmatch=] groovy:000> m[0] ===> [/*a*/ /*b*/, /*a*/ /*b*/] groovy:000> m[1] ERROR java.lang.IndexOutOfBoundsException: index is out of range -1..0 (index = 1) at groovysh_evaluate.run (groovysh_evaluate:2) ... groovy:000> m = "/*a*/ /*b*/" =~'(/\\*.*?\\*/)' ===> java.util.regex.Matcher[pattern=(/\*.*?\*/) region=0,11 lastmatch=] groovy:000> m[0] ===> [/*a*/, /*a*/] groovy:000> m[1] ===> [/*b*/, /*b*/]