regex fixed, some optimization