Groups and patterns