title: Django OperationalError: "Error 'repetition-operator operand invalid' from the regexp"
body: <p>I have asked this question before and the answer led to this error that I am unable to solve.</p>
  
  <p>I have an <code>Article</code> model that takes in articles from users. These articles can get <em>#hashtags</em> in them like we have in twitter. I have these hashtags converted to links that users can click to load all articles that have the clicked hashtags in them.</p>
  
  <p>If have these articles saved in <code>Article</code> model:</p>
  
  <pre><code>1.  'For the love of learning: why do we give #Exam?'
  2.  'Articles containing #Examination should not come up when exam is clicked'
  3.  'This is just an #example post'
  </code></pre>
  
  <p>I tried using Django's <code>__icontains</code> filter </p>
  
  <pre><code>def hash_tags(request, hash_tag):
      hash_tag = '#' + hash_tag
      articles = Articles.objects.filter(content__icontains=hash_tag)
      articles = list(articles)
      return HttpResponse(articles)
  </code></pre>
  
  <p>but if user clicks on <code>#exam</code> the three articles are returned instead of the first one.</p>
  
  <p>I can add space to <em>'#exam'</em> to become <em>'#exam '</em> and it will work out fine but I want to be able to do it with regex.</p>
  
  <p>I have tried:</p>
  
  <pre><code>articles = Articles.objects.filter(content__iregex=r"{0}\b".format(hash_tag))
  </code></pre>
  
  <p>but I get empty response.   </p>
  
  <p>And this:</p>
  
  <pre><code>articles = Articles.objects.filter(content__iregex=r"(?i){0}\b".format(hash_tag))
  </code></pre>
  
  <p>returns <strong>"Error 'repetition-operator operand invalid' from regexp"</strong></p>
  
  <p>How do I do this correctly to have it work? I am using Django 1.6 and MySQL at backend.</p>