title: Speed up regular expression
body: <p>This is a regex to extract the table name from a SQL statement:</p>
  
  <pre><code>(?:\sFROM\s|\sINTO\s|\sNEXTVAL[\s\W]*|^UPDATE\s|\sJOIN\s)[\s`'"]*([\w\.-_]+)
  </code></pre>
  
  <p>It matches a token, optionally enclosed in <code>[`'"]</code>, preceded by FROM etc. surrounded by whitespace, except for UPDATE which has no leading whitespace. </p>
  
  <p>We execute many regexes, and this is the slowest one, and I'm not sure why. SQL strings can get up to 4k in size, and execution time is at worst 0,35ms on a 2.2GHz i7 MBP.</p>
  
  <p>This is a slow input sample: <a href="https://pastebin.com/DnamKDPf" rel="nofollow noreferrer">https://pastebin.com/DnamKDPf</a></p>
  
  <p>Can we do better? Splitting it up into multiple regexes would be an option, as well if alternation is an issues.</p>