I would like to use regex to identify quotes in a string with the words between them. I also would like to include both double quotes and single quotes.
Example, If I had a string:
The "cat and the hat" sat on a rat. The 'mouse ran' up the clock.
Then it would identify the following:
cat and the hat
mouse ran
What would the regex be?
(["']).*?\1Works for me. Assuming that quotes can’t exist inside quotes…