regex any character not equal quotation 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