This question already has an answer here:
- How to escape quotes in shell? 5 answers
I've created a regex which I need to run with grep, I'm pretty sure the regex is fine as it works with online regex tools, however when I run
grep -r -P -o -h '(?<=(?<!def )my_method )(["'])(?:(?=(\\?))\2.)*?\1'
I get the error
Syntax error: ")" unexpected.