fork download
  1. import re
  2. regex = r"(\bEvent demon log entry:)(?:\r?\n|\r)+(\[[^]]+\].*)"
  3. email_body = ("Event demon log entry:\n\n"
  4. "[27/12/2018 08:15:02] CAUAJM_I_40245 EVENT: ALARM ALARM: MAXRUNALARM JOB: p1_credit_qv_curve_snap MACHINE: p1prog06")
  5.  
  6. for (g1, g2) in re.findall(regex, email_body , re.IGNORECASE):
  7. print(g1 + g2)
Success #stdin #stdout 0.02s 27744KB
stdin
Standard input is empty
stdout
Event demon log entry:[27/12/2018 08:15:02] CAUAJM_I_40245 EVENT: ALARM ALARM: MAXRUNALARM JOB: p1_credit_qv_curve_snap MACHINE: p1prog06