Search code examples
notepad++notepad

How to replace a text in pattern in notepad++


I need to replace to remove everything from "-" i.e. I need 76001,76605 etc. How do I replace these patterns in notepad ++ that has different numbers after "-"

76001 - 4
76001 - 5
76005 - 4
76005 - 5
76037 - 15
76037 - 16
76170 - 12
76170 - 13
76192 - 11
76192 - 12
76501 - 9
76501 - 10
76502 - 9
76502 - 10
76503 - 9
76503 - 10
76504 - 9
76504 - 10
76506 - 8

Solution

  • Use - \d+ (there is a leading whitespace) in "Find what" and an empty string in "Replace with" and make sure to check "Regular Expression"