For repetitive commands you may wish to take a look at
vimIt is free and is capable of operations difficult in most free text editors. It has been years since I have used it. So I forget the particular commands. But I can remember doing things like cutting all but the first sentence in each paragraph in a file and pasting it at the bottom of the file. Something like that in a lengthy file can quickly tire you out if you physically do the cut and paste operations manually. With vi(on which vim is based) it was done with one command.
I keep saying I will get back into using it myself. But I procrastinate.

I am sure it supports regular expressions.
Also for regex substitutions on each line of text processing entire files see the Linux "sed" tool. There are many "
one-liners" you can find on the web. There is a good chance what you want to do is already possible using one of them. But briefly sed is a "stream editor." It is used on the command line. You feed a file(which can also be standard input such as via a pipe on the command line) into it and it processes the text using the command and outputs the result. You can find sed for Windows as freeware if you are using Windows.
Note that with sed one-liners for Linux the file separator is a forward slash('/') instead of a backslash('\') and for that reason it is a good idea to look for a one-liner page for the Windows version of sed. That would save you having to edit the one-liner, which somewhat defeats the purpose of finding a "canned" solution to the problem.

You may be able to find a newer version of sed for Windows than
this but for command line tools it is possible they have not changed all that much since 2010 anyway.