hot-fix: group legends in legend tree

+ add quotes to metric names in regexp.