I would like to find all occurrences of /".*?"/
except when wrapped in inline code (single backtick) or code block (triple backtick).
This is what I have so far (doesn’t work as expected).
/(?<!(`|```))".*?"(?!\1)/g
In the following markdown snippet, I would like to only find "rabbit hole"
. Unfortunately, I cannot include an example of a code block (I don’t know how to escape nested triple backticks), but the same logic applies.
When copy/pasting commands that start with `cat << "EOF"`, select all lines at once (from `cat << "EOF"` to `EOF` inclusively) as they are part of the same (single) command
Figuring out how to ignore the above quoted strings is an interesting "rabbit hole".