Virtually all the text editors let you do search-and-replace, some even support regular expressions, some let you extend their functionality with macros that are quite a job to write and to learn to (you have to study the editor API and often to write the code in a relatively esoteric language).
What I want is an editor that would let you just paste a Python function in a dialogue or a panel the way you paste search and replace samples and run it, passing the entire text edited or selected as a string (or a list of strings) argument to the function and replacing it with what it returns.