示例文本:
'Times New Roman'; font-size:9pt; letter-spacing:0.05pt">test </span>
<span style="font-family:'Times New Roman'; font-size:9pt; letter-spacing:0.05pt">test </span>
<span style="font-family:'Times New Roman'; font-size:9pt; letter-spacing:0.05pt">test </span>
<span style="font-family:'Times New Roman'; font-size:9pt; letter-spacing:0.05pt">test </span>
<span style="font-family:'Times New Roman'; font-size:9pt; letter-spacing:0.05pt">6. </span>
<span style="font-family:'Times New Roman'; font-size:9pt; letter-spacing:0.05pt">Oktober </span>
<span style="font-family:'Times New Roman'; font-size:9pt; letter-spacing:0.05pt">1997</span>
<span style="font-family:'Times New Roman'; font-size:6pt; letter-spacing:0.05pt; vertical-align:super">2</span>
<span style="font-family:'Times New Roman'; font-size:9pt; letter-spacing:0.05pt">),</sp
我的正则表达式应该匹配:
<span style="font-family:'Times New Roman'; font-size:6pt; letter-spacing:0.05pt; vertical-align:super">2</span>
<span style="font-family:'Times New Roman'; font-size:9pt; letter-spacing:0.05pt">)
我的正则表达式现在是:
<span.*?>\d+?</span><span.*?>\)
结果:
<span style="font-family:'Times New Roman'; font-size:9pt; letter-spacing:0.05pt">test </span><span style="font-family:'Times New Roman'; font-size:9pt; letter-spacing:0.05pt">test </span><span style="font-family:'Times New Roman'; font-size:9pt; letter-spacing:0.05pt">test </span><span style="font-family:'Times New Roman'; font-size:9pt; letter-spacing:0.05pt">6. </span><span style="font-family:'Times New Roman'; font-size:9pt; letter-spacing:0.05pt">Oktober </span><span style="font-family:'Times New Roman'; font-size:9pt; letter-spacing:0.05pt">1997</span>***<span style="font-family:'Times New Roman'; font-size:6pt; letter-spacing:0.05pt; vertical-align:super">2</span><span style="font-family:'Times New Roman'; font-size:9pt; letter-spacing:0.05pt">)
现在已经尝试了很多,但我无法让它工作
感谢帮助