有条件的正则表达式

时间:2014-12-27 12:42:35

标签: regex vb.net

在Vb.net中我有4种类型的行

line 1:
<p>11.<span>this is</span>some text</p>
line2:
<p>a)<span>this is</span>some text</p>
line3:
<p><span>random string</span>12.<span>this is </span>some text</p>
line4:
<p><span>random string</span>a)<span>this is </span>some text</p>

我希望输出为this is some text

我正在使用regex (?<=<p.*>.*<span.*>.*?>)(.*)(?=</p>)

1 个答案:

答案 0 :(得分:0)

试试这个:

<p>.*<span>(.*?)\s*</span>(.*)</p>

并替换为\1 \2

regex101 demo