This question already has an answer here:
- How to escape quotes in shell? 4 answers
Hi 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
, I'm not really sure what the problem is, any help would be great.