如何在正则表达式中找到一个句子和一个13位数的段落代码



从一个大的段落中,我想提取句子"更新措施以排除从目录列表中添加的ean";任何介于两者之间的单词加上一个13位数字(例如:7090056511721)。

13位数字不在句尾,后面可能还有更多的单词

段落的例子:

Query Opened:/*排除添加的ean的更新措施目录列表*/笛卡尔范围:([方框].[方框].。过滤器(#。名称== "Box1") * [LocalPricePoint].[LocalPricePoint]. [LocalPricePoint]。过滤器(#。姓名== "保费") *[性别].[性别]。过滤器(#。Name == "Male") * [LocalUniverse].[LocalUniverse]。过滤器(#。名称== "创建者") *[BusinessCategory]。[BusinessCategory]。过滤器(#。名称== "框架") *[时间]。(三个月)。过滤器(#。Name == "22.2") * &CWV *[产品]。(EAN) .Filter(#。名称在{[7090056511721],[7090056511714]})*位置。(旗帜)。过滤器(#。Name == "SCCH1") *概要。[简介].Filter(#。的名字{(溢价)}));措施。[IntNewBAStatus] = 1;结束范围;

pattern = ('Updating measure to exclude the ean added from catalogue list')('any words in between')(d{13})?

我想我找到了所需的模式:

pattern = ".*(Updating measure to exclude the ean added from catalogue list).*(d{13}).*"

https://regex101.com/r/VVldPf/1

最新更新