fix regex handling