fork(1) download
  1. import re
  2. strng ="Fiscal Year Ended March 31, 2018 Total Year (in $000's)"
  3. m = re.search(r"(.*)\b(20[012]\d)\b(.*)",strng)
  4. if m:
  5. print("YEAR: {}".format(m.group(2)))
  6. print("REST: {}{}".format(m.group(1),m.group(3)))
Success #stdin #stdout 0.02s 27712KB
stdin
Standard input is empty
stdout
YEAR: 2018
REST: Fiscal Year Ended March 31,  Total Year (in $000's)