capturing regularity in languages