firstRegexp renamed, math grammar added