Skip to content

Instantly share code, notes, and snippets.

@aaronott
Last active December 11, 2015 05:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save aaronott/4551982 to your computer and use it in GitHub Desktop.
Save aaronott/4551982 to your computer and use it in GitHub Desktop.
regexp to switch firstname.lastname@email.com to lastname.firstname@email.com
%s/\(\w\+\).\(\w\+\)@/\2.\1@/
In vim, this will take a pattern such as firstname.lastname@email.com
and replace it with lastname.firstname@email.com
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment