title: Regex - No "p" at second position
body: <p>I am learning Regex and after reading <a href="https://stackoverflow.com/questions/4736/learning-regular-expressions">this post</a>, I started doing some exercises and I got stuck on this <a href="http://regex.alf.nu/5" rel="nofollow noreferrer">exercise</a>. Here are the two lists of words that should be matched and not matched</p>
  
  <p><img src="https://i.stack.imgur.com/0Vxif.png" alt="enter image description here"></p>
  
  <p>I started with</p>
  
  <pre><code>^(.).*\1$
  </code></pre>
  
  <p>and get bothered with <code>sporous</code> that get matched although it should not. So I found</p>
  
  <pre><code>^(.)(?!p).*\1$
  </code></pre>
  
  <p>that did the trick.</p>
  
  <p>The best solution (uses one less character than my solution) given <a href="https://gist.github.com/jpsim/8057500" rel="nofollow noreferrer">here</a> is</p>
  
  <pre><code>^(.)[^p].*\1$
  </code></pre>
  
  <p>but I don't really understand this pattern. Actually I think I am confused about seeing the <code>^</code> anchor in a group <code>[]</code> and I am confused about seeing the <code>^</code> anchor somewhere else than at the beginning of the regex.</p>
  
  <p>Can you help to understand what this regex is doing?</p>