fork download
  1. import re
  2. text = """Depart: NYC (etd 9/30), NJ (etd 10/4)
  3. Arrive LAX
  4. Rate: USD500, 700P"""
  5. m = re.search(r'(?s)NYC.*?\b(\d{3,})', text)
  6. if m:
  7. print(m.group(1))
Success #stdin #stdout 0.02s 9408KB
stdin
Standard input is empty
stdout
700