title: regex `match` returns different results based on order of lookup list
body: <p>I'm confused by Javascript's <code>.match</code> regex function.</p>
  
  <p>Given string:</p>
  
  <pre><code>var a = "today, I will ski with skis";
  </code></pre>
  
  <p>I want to match "today", "ski", and "skis"</p>
  
  <pre><code>a.match(/hello|today|skis|trip|ski/g);
  </code></pre>
  
  <p><strong>Output: ["today", "ski", "skis"]</strong></p>
  
  <p>The output matches my expectations.</p>
  
  <p>However, if I put "ski" before "skis" in the lookup, it stops at "ski" for both "ski" and "skis" matches:</p>
  
  <pre><code>a.match(/hello|today|ski|trip|skis/g);
  </code></pre>
  
  <p><strong>Output: ["today", "ski", "ski"]</strong></p>
  
  <p>Why won't it return both "ski" and "skis" and how do I fix it?</p>
  
  <hr>
  
  <p><strong>EDIT</strong>: to clarify, I'm looking for a dynamic solution to continue searching the list after the first set of characters is already identified. My goal is to dynamically populate the list of search terms and I can't be sure which characters to apply <code>?</code> to. </p>
  
  <p>I.e., using <code>?</code> operator for <code>skis?</code> is not dynamic since I'd have to manually add it for each possible character. If "skittles" or "ski mountain" came after "ski" these would both be ignored by <code>match</code>. <code>ski(.*)</code> gets closer but it returns everything after its bounding <code>|</code> group.</p>