I'm working with a legacy PHP project that I inherited that had over a thousand files with nothing but includes to other classes. Now that I've refactored it to use composer, and used PHPstorm to remove the references to including the classes, I have over 1200 files with nothing but an opening php tag and a few empty lines.
I was able to use this regex to find them: \<\?php\n^(\s*$){1,}\z
However, when I try to replace that with nothing, or with a string like DELETEME
PhpStorm won't actually do the replace.
Is there a way via the command line that I can recursively search for files that contain only an opening PHP tag and empty lines and then delete those files?