title: Python regex module vs re module - pattern mismatch
body: <p><strong>Update</strong>: This issue was resolved by the developer in <strong><a href="https://bitbucket.org/mrabarnett/mrab-regex/commits/be893e9f7e60946eb8cdec66e5e105f369d9437b" rel="noreferrer">commit be893e9</a></strong> </p>
  
  <p>If you encounter the same problem, update your <code>regex</code> module. <br>
  You need version <code>2017.04.23</code> or above.</p>
  
  <hr>
  
  <p>As pointed out in <strong><a href="https://stackoverflow.com/a/43561401/2422125">this answer</a></strong>
  I need <strong><a href="https://regex101.com/r/n6OCBc/4" rel="noreferrer">this regular expression</a></strong>:</p>
  
  <pre><code>(?i)\b((\w{1,3})(-|\.{2,10})[\t ]?)+(\2\w{2,})
  </code></pre>
  
  <p>working with the <code>regex</code> module too...</p>
  
  <pre><code>import re     # standard library
  import regex  # https://pypi.python.org/pypi/regex/
  
  content = '"Erm....yes. T..T...Thank you for that."'
  pattern = r"(?i)\b((\w{1,3})(-|\.{2,10})[\t ]?)+(\2\w{2,})"
  substitute = r"\2-\4"
  
  print(re.sub(pattern, substitute, content))
  print(regex.sub(pattern, substitute, content))
  </code></pre>
  
  <p><strong>Output:</strong></p>
  
  <pre><code>"Erm....yes. T-Thank you for that."
  "-yes. T..T...Thank you for that."
  </code></pre>
  
  <hr>
  
  <p><strong>Q: How do I have to write this regex to make the <code>regex</code> module react to it the same way the <code>re</code> module does?</strong></p>
  
  <p>Using the <code>re</code> module is not an option as I require look-behinds with dynamic lengths.</p>
  
  <p><strong>For clarification:</strong> it would be nice if the regex would work with both modules but in the end I only need it for <code>regex</code></p>