Skip to content

Instantly share code, notes, and snippets.

@diyinfosec
Created January 28, 2020 17:06
Show Gist options
  • Save diyinfosec/c238c014491c15ea42db3561dd5b831c to your computer and use it in GitHub Desktop.
Save diyinfosec/c238c014491c15ea42db3561dd5b831c to your computer and use it in GitHub Desktop.
https://unix.stackexchange.com/questions/236920/1-what-does-this-sed-action-mean
\([^"]*\) defines a group of characters, the group is actually the found contents between the two braces (), the braces need to be escaped hence \( and \)
\1 is the contents of the first group
There could be several groups defined using multiple sets of brace pairs, they are numbered incrementally and each one can be referenced as \n (e.g. \1, \2, \3 etc) hence the name: backreference.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment