fork download
  1. import re
  2.  
  3. x = ['AUSTRALIA\nBELMONT PARK (WA', '\nR3\n1/5/4/2\n2/3/1/5\nEAGLE FARM (QLD']
  4. pattern = r"\n(.*) \("
  5.  
  6. for i in x:
  7. m = re.search(pattern, i)
  8. if m:
  9. print(m.group(1))
Success #stdin #stdout 0.03s 9520KB
stdin
Standard input is empty
stdout
BELMONT PARK
EAGLE FARM