fixed groups pattern matching
tring to reproduce #1027