For any shell command where a minor mistake has the potential of ruining your day, take a look at “try”, which will allow you to inspect the effects before running it against a live system: https://github.com/binpash/try
Though I have not used it much over the years, as I havent had to do much personal regex for a long while.