Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

5
  • Thanks for the help! However I'm getting 0 occurrences, I tried doing this with separated keywords as you suggested and it didn't work, I also tried as they were before and nothing, please check my screen capture: goo.gl/eZ7Kp
    – Gabriel
    Commented Jul 26, 2012 at 20:28
  • 1
    This regex should work: (\b\w+\b)\W+\1 for two duplicated words. I'll edit my answer. The commas are why the other regex doesn't work.
    – amiregelz
    Commented Jul 26, 2012 at 20:40
  • I tried every possible combination, no commas, only spaces, no space and comma, and yet nothing. Please enlight me, here's the text file: goo.gl/sP20z
    – Gabriel
    Commented Jul 26, 2012 at 21:59
  • The problem is that the regular expression I wrote in my answer only applies to the format (I thought) you asked for: word, word, anotherword. However, you have many instances which are a little bit different, like came across, came across and some with 3 or 4 words. Also there are words with ' like don't and it makes things more complicated in the Notepad++ regex system. The Notepad++ regex system is pretty annoying and limited as well, so the solution is to either use regex in python (or another language), or make format-specific regular expressions for the Notepad++.
    – amiregelz
    Commented Jul 26, 2012 at 23:48
  • Another problem is that most of the words that are duplicated also appear in the previous line, which makes it difficult to achieve your goal. If you'd want to remove all duplicated words, then it wasn't that difficult. You could do something like this & this. I suggest you use specific regular expressions in Notepad++ (I can help you, just tell me all the formats of the duplicated words) or consider a different approach to your problem.
    – amiregelz
    Commented Jul 27, 2012 at 0:16