regular expression match text 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]*\'))
Example 3: regular expression match text between quotes
(["'])(?:(?=(\\?))\2.)*?\1
Example 4: regex to match string not in between quotes
('[^'\\]*(?:\\.[^'\\]*)*')|\bfoe\b