Notepad++ snippets

How to change the divider symbol between the part of dates in Notepad++

Let say you have the following list of dates:

Notepad++ replace 1


01/06/2022
15/06/2022
30/12/2021
25/10/1985
01/01/2001

and you want transform them using another symbol to divide days, months and years:

Notepad++ replace 3


01-06-2022
15-06-2022
30-12-2021
25-10-1985
01-01-2001
                            

To do this in Notepad++, you can just hit CTRL + H for Replace window and the select the following:

Notepad++ replace 2

  • Find what: ([0-9]+)/+([0-9]+)/+([0-9]+)
  • Replace with: \1-\2-\3
  • Flag Regular expression
  • Do not flag . matches new lines

Back to Notepad++ cookbook page