Remove encoding in python, and fix regex matching issue.