Skip to content

Instantly share code, notes, and snippets.

@johnnymo87
Last active August 29, 2015 14:14
Show Gist options
  • Save johnnymo87/fb3e4a0f7dff7cf60d37 to your computer and use it in GitHub Desktop.
Save johnnymo87/fb3e4a0f7dff7cf60d37 to your computer and use it in GitHub Desktop.
Vim regexes
M-D to D-M
:%s:\(\d\{1,2}/\)\(\d\{1,2}/\):\2\1:g
Discard all but the last 4 digits
::%s:\v.*(\d{4}):\1:g
@johnnymo87
Copy link
Author

Date is at end of row ... some of them need 20 prepended.
:%s:\v(.*)(\d{1,2}/\d{1,2}/)(\d{1,2})$:\1\220\3:g

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