1

Possible Duplicate:
Python regex matching Unicode properties

I'm trying to port this line of code in PHP to Python:

preg_match_all('/\p{L}[\p{L}\p{Mn}\p{Pd}\'\x{2019}]*/u', $text, $tmp);

What I got:

tmp = re.split('\p{L}[\p{L}\p{Mn}\p{Pd}\'\u2019]*', text, flags=re.U)

But... Python's regular expression syntax doesn't supports \p - Unicode character properties!

Any alternative?

Community
  • 1
  • 1
Paulo Freitas
  • 13,194
  • 14
  • 74
  • 96

0 Answers0