fork(1) download
  1. import re
  2. s = '19 Aug standing order rent Apolo Housing Assoc. 500.00 50.00\n20 Aug transfer from John wick saving a/c 200.00 130.90'
  3. rx = r'\b(transfer|rent)\D+(\d+(?:[,.]\d+)*)'
  4. for m in re.finditer(rx, s):
  5. print(f'{m.group(1)} {m.group(2)}')
Success #stdin #stdout 0.02s 9368KB
stdin
Standard input is empty
stdout
rent 500.00
transfer 200.00