It happened I need to add (or change, or change order) a new function "FunctionB()" into an existing code base (php files, ie. text files) based on rule like the following: in the main section, ie. after the unique substring "MAIN CODE" ... find the second IF then else block and insert a new function "FunctionB(...)" block of code while original text is kept and would continue after the new insertion. - So not a simple search and replace and opposite extreme would be parsing of the code to tokens etc. - Now, I'm doing it in another programming language in my command, basically as a series of individiual processing steps while looping files and lines with some decision making logic. I'm not proficient enough in regular expressions compared to this "programming" technique, when I don't loose time experimenting with regex. I'm also able to evaluate, how much time and effort I will need to achieve required "text transformation".
My question: is there a tool to do it in more "clickable" way in order to define the rules ? Something analogic to "Query builder GUIs" for data? And I don't mean Informatica (= overkill), and I know awk/sed, of course. Some utility specializing exactly on defining text manipulation rules. I was considering to write it myself at least as a working tool, but that must have been solved already ?