我正在使用正则表达式。
我想匹配给定图像的sl块的高度。 在示例中,我有两个图像,分别为image1.png和image2.png。
当我在后面使用时,它总是与第一个高度匹配,但是我想匹配与图像所在的sl块相对应的那个高度。
使用示例中的代码,如果选择了image1.png,则正则表达式应返回300.45678,对于image2.png,则应返回300。
<div class="sl-block" data-block-type="img" style="width: 600px; height: 300.45678px; left: 0px; top: 0px;" data-name="img-b59ef5">
<div class="sl-block-content" style="z-index: 11;">
<img seamless="" scrolling="no" width="600" height="400" frameborder="0" src="/static/revealjs/img/test_size/image1.png" data-lazy-loaded="">
</div>
</div>
<div class="sl-block" data-block-type="img" style="width: 600px; height: 300px; left: 0px; top: 0px;" data-name="img-b59ef5">
<div class="sl-block-content" style="z-index: 11;">
<img seamless="" scrolling="no" width="600" height="400" frameborder="0" src="/static/revealjs/img/test_size/image2.png" data-lazy-loaded="">
</div>
</div>