import re
text="name of company.\nlastname, firstname - 12345\nDates of Service Diag Xref Proc Code Voucher POS/TOS Units Provider Al/As Other Plan Bill Amt Receipts Net"
Re_text = re.compile(r'([A-Za-z]+)(?:,\s+([A-Za-z]+))?,\s+([A-Za-z]+)\s+-\s+(\d+)$', re.M)
m = Re_text.search(text)
if m:
	print(m.group(1))
	print(m.group(2))
	print(m.group(3))
	print(m.group(4))