: regex module, . 50% PCRE (. regex101.com):
^
(\d{1,3})\s++
((?>[^£\n]+))£\s++
([ \d]+)(?>[^∑\n]+)∑\s++
([ \d]+)
, :
import regex as re
rx = re.compile(r'''
^
(\d{1,3})\s++
((?>[^£\n]+))£\s++
([ \d]+)(?>[^∑\n]+)∑\s++
([ \d]+)''', re.M | re.X)
matches = [[group.strip() for group in m.groups()] for m in rx.finditer(data)]
print(matches)
:
[['145', 'Total turnover from trade', '5 2 0 0 0', '0 0'], ['155', 'Trading profits', '5 5 6 1', '0 0'], ['165', 'Net trading profits ≠ box 155 minus box 160', '5 5 6 1', '0 0'], ['235', 'P rofits before other deductions and reliefs ≠ net sum of', '5 5 6 1', '0 0'], ['300', 'Profits before qualifying donations and group relief ≠', '5 5 6 1', '0 0'], ['315', 'Profits chargeable to Corporation Tax ≠', '5 5 6 1', '0 0'], ['475', 'Net Corporation Tax liability ≠ box 440 minus box 470', '1 0 5 6', '5 9'], ['510', 'Tax chargeable ≠ total of boxes 475, 480, 500 and 505', '1 0 5 6', '5 9'], ['525', 'Self-assessment of tax payable ≠ box 510 minus box 515', '1 0 5 6', '5 9'], ['600', 'Tax outstanding ≠', '1 0 5 6', '5 9']]