Skip to content

Instantly share code, notes, and snippets.

@jheath
Created September 5, 2012 18:39
Show Gist options
  • Save jheath/3642286 to your computer and use it in GitHub Desktop.
Save jheath/3642286 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