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
user222758
  • 12,347
  • 13
  • 71
  • 93

0 Answers0