regex - Find/Match every similar words in word list in notepad++ -


  1. i have word list in alphabetical order.
  2. it ranked column.
  3. i not use programming languages.
  4. the list in notepad format.
  5. i need match every similar words , take them on same line.
  6. i use regex can't achieve correct results.

first list like:

accept accepted accepts accepting calculate calculated calculates calculating fix fixed 

a list want:

accept    accepted   accepts    accepting calculate calculated calculates calculating fix       fixed 

this seems work, have replace all multiple times:

find (^(.+?)\s*?.*?)\r\2 , replace \1\t\2. . matches newline should disabled.

how works:

it finds characters @ start of line ^(.+?), linebreak \r, , same characters again \2.

\s*?.*? used skip unnecessary characters after multiple replace all. \s*? skips first whitespace, , .*? remaining chars on line.

match replaced \1\t\2, \1 matched in (^(.+?)\s*?.*?), , \2 matched (.+?). \t used insert tab character replace linebreak.

how breaks:

note not work different words similar prefix, like:

hand hands handle handles 

this hand hands handle handles after 2 replaces.


Comments

Popular posts from this blog

windows - Single EXE to Install Python Standalone Executable for Easy Distribution -

c# - Access objects in UserControl from MainWindow in WPF -

javascript - How to name a jQuery function to make a browser's back button work? -