The general lookahead technique to assert that something is not inside double quotes is to check that there is an even number of them until the end of the string:
yourPatternHere(?=[\s\S]*(?:"[\s\S]*"[\s\S])*$)
But you are operating on HTML. This may cause all sorts of problems (unmatched quotes in text nodes, comments, single quote delimited attribute values and so on). Don't use regular expressions to parse HTML. Instead use JavaScript's built-in DOM manipulating capabilities as far as possible. Don't just find the .title
elements, but traverse their text nodes instead and apply the replacement only to those.