当第一个单词出现在最后一个单词globaly之前两次时,regex在两个单词之间匹配最少的单词


regex match fewest words between two words when the first word is present twice before the last word globaly

我有这个内容:

3014/2010布隆方丹自由州高等法院(南非共和国)在原告FIRSTRAND BANK LIMITED和第一被告ANDREA MAXWELL MOSES TOBIAS(身份证号7111175172087)和第二被告JENNEFER THERESA TOBIAS,被告的以下财产将于2013年10月23日(星期三)10:00在布隆方丹植物园第三街6A号Sheriff west房产处通过公开拍卖出售给出价最高的投标人,即:财产描述:确定:Erf 3354,Ashbury,Extension 7,District Bloemonstein,自由邦省,更为人所知的是自由邦省布隆方丹阿什伯里Hillcrest街15号,面积496(四九六)平方米,根据第T20116/1995号转让契约持有。该地产已划为住宅区。住宅包括:休息室、厨房、3间卧室、1间淋浴间、1间厕所、4间车库。(改进的性质、范围、条件和存在不受保证,而是以"voestots"出售)。新增:无。销售条件将在销售执行前由警长阅读,并可在地址为布隆方丹Arboretum第七街3号的东警长办公室和/或原告律师Messrs Symington&De Kok,布隆方丹纳尔逊·曼德拉大道169B号。请进一步注意:这是根据上述法院的判决执行的出售。本次拍卖的规则可在拍卖前24小时在布隆方丹植物园第七街3号东区警长办公室查询。在符合某些条件的情况下,需要注册为买家,即2008年第68号《消费者保护法》的3.1指示(URLhttp://www.info.gov.za/view/DownloadFileAction?id=99961)3.2 Fica立法i.r.o.身份&地址详情。3.3注册资金的支付。3.4注册条件。执行中的拍卖将在西部警长办公室举行,地址为布隆方丹Westdene Barnes街5号,由拍卖商P Roodt和A J Kruger进行。按现行出版收费标准计算的广告成本;根据法院规则的销售费用将适用。原告律师Sonette Oosthuizen,Symington&De Kok,Symington&德科克大厦,布隆方丹纳尔逊·曼德拉大道169B号。电话:(051)505-6727。(参考号:MT1089/carol.)布隆方丹东区警长。电话:(051)447-3784。STAATSKOERANT,11 OKTOBER 2013编号36907 151 VEILING

我有这个Regex模式:/(?i)警长(.*?)''bEast''b/g

我得到这个结果:

匹配11.[610-1355]west, 6A Third Street, Arboretum, Bloemfontein, to the highest bidder, namely: Property description: Certain: Erf 3354, Ashbury, Extension 7, District Bloemontein, Free State Province and better known as 15 Hillcrest Street, Ashbury, Bloemfontein, Free State province, measuring 496 (four nine six) square metres, held by Deed of Transfer No. T20116/1995. The property is zoned: Residential. A residential dwelling consisting of: Lounge, kitchen, 3 x bedrooms, 1 x shower, 1 x toilet, 4 x garages. (The nature, extent, condition and existence of the improvements are not guaranteed and are sold ?voestoots?). Additions: None. The conditions of sale will be read prior to the sale in execution by the Sheriff and may be inspected at the Sheriff-

匹配22.[1744-1746],

匹配31.[2176-2592]West, with address 5 Barnes Street, Westdene, Bloemfontein, and will be conducted by auctioneers P Roodt and A J Kruger. Advertising costs at current publication tariffs & sale costs according Court Rules will apply. Sonette Oosthuizen, Attorney for Plaintiff, Symington & De Kok, Symington & De Kok Building, 169B Nelson Mandela Drive, Bloemfontein. Tel: (051) 505-6727. (Ref: MT1089/carol.) Sheriff, Bloemfontein

我想要的结果:

匹配11.[610-1355]-

匹配22.[1744-1746],

匹配31.[2176-2592], Bloemfontein

图案与第一个"警长"和第一个"东部"相匹配,但在两者之间还有另一个"治安官"。我希望它能匹配最接近的两个单词(第二个"警长"和第一个"东部")。它还需要全球化。

任何想法都将不胜感激。

sheriff((?:(?!sheriff).)*?)'bEast'b

试试这个。这是有效的。请参阅演示。

http://regex101.com/r/lE9oV4/3