Regularity theorems, groups, and VC-dimension