In general, no. This kind of stuff is not in the domain of regular languages as you need some sort of memory to track the occurrences of quotes.
However modern regexps are more powerful then simple regular languages, so it might be possible. But I'd go for something like this:
- loop through each letter, if you see a quote then flip a boolean variable
- if you see foo and the variable is true, continue, otherwise return false
- if you then see a quote return true
Use more then a boolean if you care about single and double quotes.