Skip to content

Instantly share code, notes, and snippets.

@mikybars
Last active February 18, 2019 23:31
Show Gist options
  • Save mikybars/7aca3027bd7fa76f8b266666b7775150 to your computer and use it in GitHub Desktop.
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
# Lowercase all html tags
$ ex - '+%s,<\(.*\)>,<\L\1>,' -cwq index.html
# 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