Skip to content

Instantly share code, notes, and snippets.

@RShergold
Created February 1, 2017 12:23
Show Gist options
  • Save RShergold/fa840ef7f9b227af9e04d5ca62fcff04 to your computer and use it in GitHub Desktop.
Save RShergold/fa840ef7f9b227af9e04d5ca62fcff04 to your computer and use it in GitHub Desktop.
swap keys and values with sublime replace
text content:
'AF' => 'Afghanistan'
'AX' => 'Aland Islands'
'AL' => 'Albania'
'DZ' => 'Algeria'
...
(regex mode on)
find: ('\w\w') => ('.*')
replace: $2 => $1
result:
'Afghanistan' => 'AF'
'Aland Islands' => 'AX'
'Albania' => 'AL'
'Algeria' => 'DZ'
...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment