title: C# - Regex replace if not inside of quotes
body: <p>Let's take this block of code:</p>
  
  <pre><code>string Val = "I like foo, baz and bar, they where before \"foo, baz and bar\"";
  
  string[] first = {
      "foo",
      "baz",
      "bar"
  };
  
  string[] second = {
      "java",
      "php",
      "ruby"
  };
  </code></pre>
  
  <p>Look that inside my Val string I have a text, I want to replace only the part which isn't inside of the quotes (\"), but if I do</p>
  
  <pre><code>Val = Regex.Replace(Val, first, second);
  </code></pre>
  
  <p>It just gives me</p>
  
  <pre><code>I like java, php and ruby, they where before "java, php and ruby"
  </code></pre>
  
  <p>While I expect</p>
  
  <pre><code>I like java, php and ruby, they where before "foo, baz and bar"
  </code></pre>
  
  <p>Can someone help to solve this problem? I didn't find any documentation explaining it.</p>