Skip to content

Instantly share code, notes, and snippets.

@evanportwood
Forked from jheath/gist:3642286
Created September 6, 2012 13:09
Show Gist options
  • Save evanportwood/3656091 to your computer and use it in GitHub Desktop.
Save evanportwood/3656091 to your computer and use it in GitHub Desktop.
RegEx replace with lowercased value

if you have a string like "6FA34323-C71F-4FD4-996F-002CE77E6B77"

search w/ regexp using ("[A-Z0-9-]+") replace with \L$1

\U will uppercase


Vim version:

%s/\([A-Z0-9]\{8}\)-*\([A-Z0-9]\{4}\)-*\([A-Z0-9]\{4}\)-*\([A-Z0-9]\{4}\)-*\([A-Z0-9]\{12}\)/\L\1\2\3\4\5/gc
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment