regex match string between quotes code example
Example 1: regex to get items between quotes
(["'])(?:(?=(\\?))\2.)*?\1
Example 2: regex to match string not in between quotes
((?!\'[\w\s]*[\\']*[\w\s]*)foe(?![\w\s]*[\\']*[\w\s]*\'))
(["'])(?:(?=(\\?))\2.)*?\1
((?!\'[\w\s]*[\\']*[\w\s]*)foe(?![\w\s]*[\\']*[\w\s]*\'))