我可以在HTML文件中使用结构搜索来查找嵌套标签吗?

时间:2019-01-24 11:22:46

标签: intellij-idea structural-search

我想找到并替换嵌套在父标记内的一些子标记。 这是我的模板:

<$tag$ $attribute$=$value$>
    <$childTag$ $childAttr$=$childValue$ />
<$tag$/>

我通过正则表达式将文本过滤应用于$value$$childValue$

  • $value$过滤器为.*sm-landing-appstore-app-1-gallery--main.*
  • $childValue$过滤器为sm-landing-appstore-app-1-gallery__slide-img

这是HTML文档的一部分,我想在其中找到我的sm-landing-appstore-app-1-gallery__slide-img并将其替换:

<div class="sm-landing-appstore-app-1-gallery__main-gallery">
    <div class="sm-landing-appstore-app-1-gallery__main-gallery-frame-wr swiper-container">
        <div class="sm-landing-appstore-app-1-gallery__frame sm-landing-appstore-app-1-gallery__main-gallery-frame swiper-wrapper">

            <div class="sm-landing-appstore-app-1-gallery__slide sm-landing-appstore-app-1-gallery__main-gallery-slide sm-landing-appstore-app-1-gallery__main-gallery-slide--screenshot swiper-slide"
                 data-index="0" data-id="0">
                <div id="cmp-6" class="sm-ratio sm-landing-appstore-app-1-gallery__slide-in">
                    <div class="sm-ratio__placeholder"></div>
                    <div class="sm-ratio__body">
                        <div class="sm-landing-appstore-app-1-gallery__slide-cv"><img
                                class="sm-landing-appstore-app-1-gallery__slide-img"
                                src="img/Fitness%20Buddy/1.jpg" alt="EasyFitness gallery 1" data-number-image="1">
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>

但是我的搜索模板的语法不正确。
使用IntelliJ结构搜索是否甚至可以找到嵌套标签?

0 个答案:

没有答案