Last active
February 18, 2019 23:31
-
-
Save mikybars/7aca3027bd7fa76f8b266666b7775150 to your computer and use it in GitHub Desktop.
sed & ex examples showcasing use cases of regex syntax for group capturing & backreferencing
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
# Lowercase all html tags | |
$ ex - '+%s,<\(.*\)>,<\L\1>,' -cwq index.html |
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
# Uncomment lines respecting indentation | |
$ sed -e 's,^\([[:space:]]*\)#\([^!].*\),\1\2,' test.sh |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment