如何从正则表达式中提取下一个/上一个文本

时间:2017-01-30 08:27:20

标签: regex jmeter

我有一个长字符串,其中包含多次相同的文本。与下面字符串中的'id'参数类似:

id="left" class="pr" id="wrap" id="main" id="wrapper" id="logo_wrapper" class="standard_logo_wrapper mb24" h1 style="height: 100%; display: table-cell; vertical-align: bottom;" img id="logo" class="standard_logo"

使用正则表达式[id=logo]获取上一个'id'参数[id="(.+?)" class="standard_logo"]的值时,为我提供了如下所述的完整字符串,而不仅仅是“徽标”文字:

left" class="pr" id="wrap" id="main" id="wrapper" id="logo_wrapper" class="standard_logo_wrapper mb24" h1 style="height: 100%; display: table-cell; vertical-align: bottom;" img id="logo"

请让我知道正则表达式可用于处理此类情况。

0 个答案:

没有答案