Fix bytes regex for Python 3.

Closes gh-4602
Merge pull request #4609 from takluyver/i4602

Fix bytes regex for Python 3.