fork download
  1. import re
  2.  
  3. str = u"0123456789\u0660\u0661\u0662\u0663\u0664\u0665\u0666\u0667\u0668\u0669";
  4. m1 = re.search(ur'\d+', str, re.UNICODE)
  5. m2 = re.search(ur'\d+', str)
  6.  
  7. print m1.group(0).encode('utf-8')
  8. print m2.group(0).encode('utf-8')
  9.  
  10.  
Success #stdin #stdout 0.01s 7728KB
stdin
Standard input is empty
stdout
0123456789٠١٢٣٤٥٦٧٨٩
0123456789