Replacing '-' with '/' in Notepad++

Solution 1:

  • Ctrl+H
  • Find what: =(\d\d)-(\d\d)-(\d{4})$
  • Replace with: =$1/$2/$3
  • CHECK Wrap around
  • CHECK Regular expression
  • Replace all

Explanation:

=           # equal sign
(\d\d)      # group 1, 2 digits (the day/month)
-           # hyphen
(\d\d)      # group 2, 2 digits (the month/day)
-           # hyphen
(\d{4})     # group 3, 4 digits (the year)
$           # end of line

Replacement:

=           # equal sign
$1          # content of group 1 (the day/month)
/           # a slash
$2          # content of group 2 (the month/day)
/           # a slash
$3          # content of group 3 (the year)

Screenshot (before):

enter image description here

Screenshot (after):

enter image description here