使用 RegEx(notepad++) 删除重复的字符串/单词(不是行) [英] Removing duplicate strings/words(not lines) using RegEx(notepad++)

查看:108
本文介绍了使用 RegEx(notepad++) 删除重复的字符串/单词(不是行)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想知道一种使用记事本++正则表达式查找工具删除文本文件(不是行)中重复单词或字符串的方法.

I would like to know a way to remove duplicate words or strings in a text file(not lines) using notepad++ regex find tool.

我只看到了使用 TextFx 删除重复行的方法,而这不是我想要的.

I only saw ways to remove duplicate lines using TextFx and that is not what i am looking for.

示例 -

123/789123/321

123 / 789 123 / 321

删除 123 将导致

123/789/321

123 / 789 / 321

推荐答案

我不熟悉 Notepad++,但假设它使用标准语法,请替换

I'm not familiar with Notepad++, but assuming it uses standard syntax, replace

\b(\w+)\b([\w\W]*)\b\1\b

$1$2

这篇关于使用 RegEx(notepad++) 删除重复的字符串/单词(不是行)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆