title: strange python regex behavior - maybe connected to unicode or sqlalchemy
body: <p>I'm trying to search for a pattern in sqlalchemy results (actually filter by a 'like' or 'op'('regexp')(pattern) which I believe is implanted with regex somewhere) - the string and the search string are both in hebrew, and presumably (maybe I'm wrong-)-unicode
  where <code>r = u'לבן'</code> and <code>c = u'לבן, ורוד,    '</code>
  when I do <code>re.search(r,c)</code> I get the <code>SRE.match</code> object
  but when I query the db like:</p>
  
  <pre><code>f = session.query(classname)
  c = f[0].color
  </code></pre>
  
  <p>and c gives me:</p>
  
  <pre><code>'\xd7\x9c\xd7\x91\xd7\x9f,\xd7\x95\xd7\xa8\xd7\x95\xd7\x93,'
  </code></pre>
  
  <p>or <code>print (c):</code></p>
  
  <pre><code>לבן,ורוד,
  </code></pre>
  
  <p>practicaly the same but running <code>re.search(r,c)</code> gives me no match object.</p>
  
  <p>Since I suspected a unicode issue I tried to transform to unicode with <code>unicode(c)</code>
  and I get an 'UnicodeDecodeError: 'ascii' codec can't decode byte 0xd7 in position 0: ordinal' which I guess means this is already unicode string - so where's the catch here?
  I would prefer using the sqlalchemy <code>'like'</code> but I get the same problem there = where I know for sure (as I showed in my example that the data contains the string)</p>
  
  <p>Should I transform the search string,pattern somehow? is this related to unicode? something else?</p>
  
  <p>The db table (which I'm quering) collation is utf8_unicode_ci</p>