title: Regular expression to match [^'] but also \' in string
body: <p>I am parsing a .SQL file and try to write it to Mongodb.</p>
  
  <p>I used this regular expression, </p>
  
  <pre><code>\((\d+),'([^']+)'(?:,(\d+))(?:,(\d+))(?:,(\d+))\)
  </code></pre>
  
  <p>, it worked for most of the cases.</p>
  
  <pre><code>(431532,'Fluorescent_cheese_dyes',0,0,0),(431533,'Christian_Rock_albums',0,0,0),
  (431534,'Variety_radio_stations',0,0,0),(431535,'Dean\'s_list',0,0,0),
  </code></pre>
  
  <p>But it did not for the last case about where there is <code>\'</code>, as I used <code>'([^']+)'</code> to match the string. When I change <code>'([^']+)'</code> into <code>'((?:(?:\')|[^'])+)'</code>, it will match all the cases in one instance rather than 4. The groups will be like this:</p>
  
  <pre><code>1.  431532
  2.  Fluorescent_cheese_dyes',0,0,0),(431533,'Christian_Rock_albums',0,0,0),(431534,'Variety_radio_stations',0,0,0),(431535,'Dean\'s_list
  3.  0
  4.  0
  5.  0
  </code></pre>
  
  <p>How can I deal with this, where the second group matches the string with <code>\'</code>?</p>