我们如何使用正则表达式删除或过滤数据以在中间删除数据?起点是第一个日期(日期可以是动态的,它不是固定的),例如 08/03/2020,终点是大写字母字符串中的最后 3 个(这也是动态的,但大写字母最多只能包含 3 个字符) 例如下面字符串中的 TRU。并且应该在此之后忽略或删除所有数据
这是我当前的正则表达式:
Regex.Match(text,"(?<=08/03/2020\s+)[\S\s]*?(?=TRU)").Value.Trim
但它不是动态的。
这将被删除,因为这已经在 08/03/2020 和 TRU 之后。
知道我们如何为这个设计一个正则表达式吗?谢谢你。#要删除的数据
Processing
Co-Applicant
No inquiry records found."
#字符串
"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."
#预期输出
"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