in reply to grep using regex

Because the .. flipflop operator remembers its state, you will run into problems if you use it in a loop like that and expect it to automatically reset each time you start the grep loop. That's only safe to do if you only ever run that grep once.