title: Python regex error: look-behind requires fixed-width pattern
body: <p>The following regex is supposed to match any <code>:text:</code> that's preceeded by <code>start-of-string</code>, <code>whitespace</code> or <code>:</code>, and succeeded by <code>end-of-string</code>, <code>whitespace</code> or <code>:</code> (Along with a few extra rules)</p>
  
  <p>I'm not great at regex but I've come up with the desired solution in regexr.com:</p>
  
  <pre class="lang-regex prettyprint-override"><code>(?&lt;=\s|:|^)(:[^\s|:]+:)(?=\s|:|$)
  </code></pre>
  
  <pre class="lang-regex prettyprint-override"><code>:match1::match2: :match3:
  :match4:
  000:matchNot:
  :matchNot:000
  :match Not:
  </code></pre>
  
  <p>Result: <code>:match1:</code>, <code>:match2:</code>, <code>:match3:</code>, <code>:match4:</code></p>
  
  <p>But on Python 3 this raises an error.</p>
  
  <pre class="lang-py prettyprint-override"><code>re.search("(?&lt;=\s|:|^)(:[^\s|:]+:)(?=\s|:|$)", txt)
  </code></pre>
  
  <p><strong>re.error: look-behind requires fixed-width pattern</strong></p>
  
  <p>Anyone know a good workaround for this issue? Any tips are appreciated.</p>