title: Does it ever make sense to have a caret or dollar sign in the middle of a regular expression?
body: <p>Consider the following regular expressions:</p>
  
  <pre><code>/xyz^abc/
  /xyz$abc/
  </code></pre>
  
  <p>What will these match?</p>
  
  <p>I know that</p>
  
  <ul>
  <li>the caret (<code>^</code>), when used at the beginning of a regex, matches the beginning of lines</li>
  <li>the dollar sign (<code>$</code>) , when used at the end of a regex, matches the end of lines</li>
  <li>the caret (<code>^</code>), when used as the first character of a character class, negates the class</li>
  </ul>
  
  <p>I believe the given regular expressions won't ever match anything, but I am not sure.</p>