title: Python regular expression: treat apostrophe as text
body: <p>My goal is to find a word in a text. The caveat is that I need to treat apostrophes as text.</p>
  
  <p>Let me explain with an example. Let's say I'm looking for the word <code>don</code> in the text: <code>don't trust don</code>. I need to match <code>don</code> but not <code>don't</code>.</p>
  
  <p>I started with this regex: <code>r'(?:\b)%s(?:\b)' % re.escape("don")</code> but here it matches both occurrences of <code>don</code>. I then tried <code>r'(?:\b|\w\')%s(?:\b|\'\w)' % re.escape("don")</code>, to no avail.</p>
  
  <p>How do I make my regex treat apostrophes as text?</p>
  
  <p>Edit: Some of the edge cases I did not mention: <code>'don</code> and <code>don'</code> are correct matches whereas <code>t'don</code>, <code>don't</code> and <code>'don'</code> are not.</p>