very slow; large regex same as grep loop