regex match outer single quotes code example
Example 1: regex to match string not in between quotes
((?!\'[\w\s]*[\\']*[\w\s]*)foe(?![\w\s]*[\\']*[\w\s]*\'))
Example 2: regex to match string not in between quotes
('[^'\\]*(?:\\.[^'\\]*)*')|\bfoe\b