title: What causes these two regexes to work differently?
body: <p>I am using the following regex in a Java calculator program to tokenize input:</p>
  
  <p><code>((?&lt;=[(^+/*-])|(?=[(^+/*-]))</code></p>
  
  <p>I was previously using this regex (note that the caret is moved to the end):</p>
  
  <p><code>((?&lt;=[(+/*-^])|(?=[(+/*-^]))</code></p>
  
  <p>This one caused problems because multi-digit inputs would be cut up into individual characters. i.e., "11" would split into "1", "1".</p>
  
  <p>I know that the caret is a special character at the front of a character class, but why does it cause the regex to work improperly when placed at the end?</p>