Q:

Groovy/Grails: Get key:value pairs satisfying a regexp

I have a map and would like to get all key:value pairs where the key matches a regular expression. I have a solution where I grep for the keySet() first them loop through and find. But there must a simpler solution (or I'm hoping).
Ex: 
def qmap = [name: "hair", style: 'straight', color_1: 'brown', color_2: 'blonde', color_3: 'black']

I would like to get a submap with just the colors.
def colors = [color_1: 'brown', color_2: 'blonde', color_3: 'black']

I can get the keys by using .grep, but this just gives me the keys and I need to loop through to get the values. 
def colorKeys = qmap.keySet().grep(~/^color.*/)

Any ideas how to do this?

A:

You could do
qmap.subMap( colorKeys )

