fork(2) download
  1. # -*- coding: utf-8 -*-
  2. import re
  3. s = "הmאפrקt sam"
  4. match = re.search(ur'\w*m\b', s.decode('utf8'), flags=re.UNICODE)
  5. if match:
  6. print(match.group(0).encode("utf8"))
  7.  
  8. print([x.encode("utf8") for x in re.findall(ur'\w*m\b', s.decode('utf8'), flags=re.UNICODE)])
Success #stdin #stdout 0s 23304KB
stdin
Standard input is empty
stdout
sam
['sam']