better regexp handling