title: How can I concatenate regex literals in JavaScript?
body: <p>Is it possible to do something like this?</p>
  
  <pre><code>var pattern = /some regex segment/ + /* comment here */
      /another segment/;
  </code></pre>
  
  <p>Or do I have to use new <code>RegExp()</code> syntax and concatenate a string? I'd prefer to use the literal as the code is both more self-evident and concise.</p>