title: regex match slow
body: <p>I try to let use ajax upload file over 2mb with nodejs app,<br>
  client side I use <code>FileReader</code> api to save base64 then pass through <code>FormData</code>.  </p>
  
  <p>My problem is server side code like below so slow, I put <code>console.log</code> try to find which part, when upload bigger size file, seems stuck at regex <code>match</code>..<br>
  any suggestion how to improve this? </p>
  
  <p><a href="https://regex101.com/r/qS2lB2/1" rel="nofollow">https://regex101.com/r/qS2lB2/1</a> </p>
  
  <pre><code>...
  console.log(image.data_base64);  
  // 'data:image/jpeg;base64,/9j/4AAQSkZJRgABAgEASABIAAD/7QAsUGhvd ...
  var matches = image.data_base64.match(/^data:.+\/(.+);base64,(.*)$/);
  console.log('done');  // slow
  
  var fileExtension = matches[1];
  var base64 = matches[2];
  var buffer = new Buffer(base64, 'base64');
  
  ...
  yield Promise.resolve( filesystem().writeFile(temporaryFilePath, buffer) );
  </code></pre>