Swag
Swag

Reputation: 51

Removing duplicate strings/words(not lines) using 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.

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

Example -

123 / 789 123 / 321

Removing 123 would result in

123 / 789 / 321

Upvotes: 4

Views: 5272

Answers (1)

Andrew Cheong
Andrew Cheong

Reputation: 30273

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

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

with

$1$2

Upvotes: 4

Related Questions