Clean up unitypackage with editor script

I’d like to make an editor script that modifies *.cs files. I want it to do a regex type of search and replace. This search will remove lines from the code such as “// TODO:”. I’m want this so that the code in an exported unitypackage will look cleaner.

Is there any way to do this kind of automated clean up with editor scripts? Is there a good alternative?

You’d first handle access to the *.cs files using something similar to: Editor script need to create Class Script automatically - Unity Answers

Then you can do the regex parsing using something similar to: .net - Regex to strip line comments from C# - Stack Overflow