I am working on a project wherein I need to split the string below into multiple groups. I am using Named Regular expression to split into 3 groups:
- InvoiceNumber
- Description
- InvoiceAmount
671217 John Doe v Monica Geller, et al. $55.50 Pertains To: Joey Tribuiani Firm's File # ABCDEF-123 Claim No# 1237474
I am using the following regular expression:
search = '(?P<InvoiceNumber>\d+)\s+(?P<Description>.*?)\s+(?P<InvoiceAmount>.*?)\s+'
(?P<InvoiceNumber>\d+)\s+.*?(?P<Description>\$\d+(?:\.\d+)?)\s+(?P<InvoiceAmount>.*(?:\r?\n.*)*)regex101.com/r/ly0Zjl/1