fork(1) download
  1. import re
  2. text = "JAKARTA, INDONESIA (1 February 2017)"
  3. countryRegex = re.compile(r',\s*([a-zA-Z]+)\s*\(')
  4. mo = countryRegex.search(text)
  5. if mo:
  6. print(mo.group(1))
Success #stdin #stdout 0s 9024KB
stdin
Standard input is empty
stdout
INDONESIA