title: Regex pattern for adding N before string value in sql statement
body: <p>I need help with the regex pattern to add N before all string values in sql-statements</p>
  
  <p>For example:</p>
  
  <p><strong>Before:</strong> <code>SELECT * FROM table WHERE column = '123';</code><br>
  <strong>After:</strong> <code>SELECT * FROM table WHERE column = <b>N</b>'123';</code></p>
  
  <p>In that example, I can use this pattern: <code>'[^']+'</code>.  However, I need help with pattern for this example:</p>
  
  <p><strong>Before:</strong> <code>SELECT * FROM table WHERE column1 = 'One''Two' AND column2 = 'abc';</code><br>
  <strong>After:</strong> <code>SELECT * FROM table WHERE column1 = <b>N</b>'One''Two' AND column2 = <b>N</b>'abc';</code></p>
  
  <p>If there's a double <code>''</code>, it should skip those.</p>
  
  <p><strong>Information about my problem:</strong> <a href="https://web.archive.org/web/20150114081311/http://support.microsoft.com:80/kb/239530/en-us" rel="nofollow noreferrer" title="ARCHIVE of http:&#47;&#47;support.microsoft.com/kb/239530/en-us">You must precede all Unicode strings with a prefix N when you deal with Unicode string constants in SQL Server</a></p>