Please help me with correct regex to get below output
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]+)( - +\d+$)')
Expected output:
lastname
firstname
Middle initial (might not come for all scenarios)
12345