How do we remove or filter data using regex to remove data after an in between ? The starting point is the first date (date could be dynamic it is no the fixed) so for example 08/03/2020 and the endpoint is the last 3 in capslock string (which is also dynamic but only up to 3 characters in capital letters) for example TRU in the string below. And should ignore or remove all the data after that
This is to be remove since this is already after the 08/03/2020 and TRU.
Any idea how we can design a regex for this one ? thank you.
#data to be remove
Processing
Co-Applicant
No inquiry records found."
#The String
"08/03/2020 NOVUS HOME Mortgage Company TRU
MORTGAGE
07/08/2020 FACTUAL DATA Mortgage Reporter XPN
07/08/2020 FCTUALDATA EFX
07/08/2020 NOVUS HOME Mortgage Company TRU
MORTGAGE
07/07/2020 CROSSCOUNTRY Mortgage Loan TRU
MORTGAG
07/07/2020 FACTUAL DATA Mortgage Reporter XPN
07/07/2020 FCTUALDATA EFX
05/21/2020 CAP ONE NA Bank Credit Card XPN
05/21/2020 CAPITAL ONE Credit Card TRU
05/21/2020 CAPITALONE Bank EFX
05/20/2020 CROSSCOUNTRY Mortgage Loan TRU
MORTGAG
05/20/2020 FACTUAL DATA Mortgage Reporter XPN
05/20/2020 FCTUALDATA EFX
05/20/2020 FINGERHUT/WEBBANK Finance Company XPN
05/07/2020 EMS EFX
05/07/2020 GROW FINANCIAL CREDI Credit Bureau/Mortgage TRU
Processing
Co-Applicant
No inquiry records found."
#Expected output
"08/03/2020 NOVUS HOME Mortgage Company TRU
MORTGAGE
07/08/2020 FACTUAL DATA Mortgage Reporter XPN
07/08/2020 FCTUALDATA EFX
07/08/2020 NOVUS HOME Mortgage Company TRU
MORTGAGE
07/07/2020 CROSSCOUNTRY Mortgage Loan TRU
MORTGAG
07/07/2020 FACTUAL DATA Mortgage Reporter XPN
07/07/2020 FCTUALDATA EFX
05/21/2020 CAP ONE NA Bank Credit Card XPN
05/21/2020 CAPITAL ONE Credit Card TRU
05/21/2020 CAPITALONE Bank EFX
05/20/2020 CROSSCOUNTRY Mortgage Loan TRU
MORTGAG
05/20/2020 FACTUAL DATA Mortgage Reporter XPN
05/20/2020 FCTUALDATA EFX
05/20/2020 FINGERHUT/WEBBANK Finance Company XPN
05/07/2020 EMS EFX
05/07/2020 GROW FINANCIAL CREDI Credit Bureau/Mortgage TRU