Something like:
def match = \"John 19\" =~ /(&name&)\\w+ (&age&\\d+)/
def name = match.name
def age = match.age
Is there a
Alternative:
def foo = '''(id:(1 2 3)) OR (blubb)
(id:(4 5 6)) OR (fasel)
'''
def matcher = (foo =~ /\(id:\((.+)\)\) OR (.*)/)
def (whole, bar, baz) = matcher[0]
assert whole == '(id:(1 2 3)) OR (blubb)'
assert bar == '1 2 3'
assert baz == '(blubb)'
(whole, bar, baz) = matcher[1]
assert whole == '(id:(4 5 6)) OR (fasel)'
assert bar == '4 5 6'
assert baz == '(fasel)'