in reply to Regexp doubts

Update: Tested. Fixed. I knew I needed that \z.
Update: Added third solution, a simplification of the second.