Groups for patterns