我有一个文本文件,我想查找和删除(替换为空)一个相似但不相同的部分

I have a text file that i want to find and delete (replace with nothing) a part that is similar but not the same

我有一个文本文件,下面有数千个代码,除了 ID 号不同外,几乎完全相同。我想查找并删除此代码的所有实例,但我不知道如何执行此操作,因为查找和替换要求文本相同。我怎样才能做到这一点? mac 上的哪个文本编辑器可以做到这一点?例如:

<br><a target='_blank' href='http://example.com/home/details/indexid/1101372'>Read More</a>

<br><a target='_blank' href='http://example.com/home/details/indexid/1101337'>Read More</a>

使用任何支持正则表达式替换的文本编辑器。例如。崇高的文字。

然后替换为<br><a target='_blank' href='http:\/\/example\.com\/home\/details\/indexid\/\d+'>Read More<\/a>