regex - Find/Match every similar words in word list in notepad++ -
- i have word list in alphabetical order.
- it ranked column.
- i not use programming languages.
- the list in notepad format.
- i need match every similar words , take them on same line.
- 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
Post a Comment