Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save nasirhafeez/3b2667b2010243ad1bf3678b59fe08f9 to your computer and use it in GitHub Desktop.
Save nasirhafeez/3b2667b2010243ad1bf3678b59fe08f9 to your computer and use it in GitHub Desktop.
NotePad++ Regular Expressions, Substitution and Backtracking

NotePad++ Regular Expressions, Substitution and Backtracking

To replace dates of the format yyyy-mm-d with the format yyyy-mm-dd use the following find expression:

^(....-..-)(.)$

And the following replace expression:

\10\2

The \1 and \2 backreference the first and second search groups (capture groups).

This operation will replace 1985-04-2 with 1985-04-02.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment