Created
August 1, 2013 23:18
-
-
Save NickStemerdink/6136215 to your computer and use it in GitHub Desktop.
sed camel case to underscore
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Command: sed -e 's/\([A-Z]\)/_\l\1/g' -e 's/^_\([a-z]\)/\1/g' | |
$ echo foo | sed -e 's/\([A-Z]\)/_\l\1/g' -e 's/^_\([a-z]\)/\1/g' | |
$ echo Foo | sed -e 's/\([A-Z]\)/_\l\1/g' -e 's/^_\([a-z]\)/\1/g' | |
$ echo SuperFooBar | sed -e 's/\([A-Z]\)/_\l\1/g' -e 's/^_\([a-z]\)/\1/g' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment