title: Regex to match values not surrounded by another char?
body: <p>This is one of the toughest things I have ever tried to do. Over the years I have searched but I just can&rsquo;t find a way to do this &mdash; match a string not surrounded by a given char, like quotes or greater/less than symbols.</p>
  
  <p>A regex like this could match URLs not in HTML links, SQL table.column values not in quotes, and lots of other things.</p>
  
  <pre><code>Example with quotes: 
  Match [THIS] and "something with [NOT THIS] followed by" or even [THIS].
  
  Example with &lt;,&gt;, &amp; " 
  Match [URL] and &lt;a href="[NOT URL]"&gt;or [NOT URL]&lt;/a&gt;
  
  Example with single quotes: 
  WHERE [THIS] LIKE '%[NOT THIS]'
  </code></pre>
  
  <p>Basically, how do you match a string (THIS) when it is not surrounded by a given char?</p>
  
  <pre><code>\b(?:[^"'])([^"']+)(?:[^"'])\b
  </code></pre>
  
  <p>Here is a test pattern: a regex like what I am thinking of would match only the first "quote".</p>
  
  <blockquote>
    <p>To quote, "quote me not lest I quote you!"</p>
  </blockquote>