Skip to main content
Stack Overflow
  1. About
  2. For Teams

Return to Question

Source Link
Teifion
  • 111.6k
  • 76
  • 165
  • 196

UTF in Python Regex

I'm aware that Python 3 fixes a lot of UTF issues, I am not however able to use Python 3, I am using 2.5.1

I'm trying to regex a document but the document has UTF hyphens in it – rather than -. Python can't match these and if I put them in the regex it throws a wobbly.

How can I force Python to use a UTF string or in some way match a character such as that?

Thanks for your help

lang-py

AltStyle によって変換されたページ (->オリジナル) /