Skip to main content
Participant
Jul 14, 2023 10:11 PM UTC
Answered

Find a section of code

I have a website with multiple pages.

 

Is it posible to find and replace a section of code that starts with <section class="display-7" and ends with </section> in Dreamweaver?

 

The html inbetween <section class="display-7" and </section> is different on every page.

 

I want to replace it with new html on multiple pages.

    This topic is closed to new replies. Start a new post to keep the conversation going.
    osgood_Correct answer
    Legend
    Jul 15, 2023 5:36 PM UTC

    Use the 'regular expression' option in find and replace (see below).

     

    Find:

    <section class="display-7">(.*)</section>

     

    Replace:

    <section class="display-7">Insert whatever content you want, to replace the current content, here</section>

     

    Although I dont use Dreamweaver anymore I'm sure it must have a regular expression option when finding and replacing content, most editors do these days

    5 replies

    Nancy OShea
    Community Expert
    Community Expert
    Jul 14, 2023 11:44 PM UTC

    Ctrl + Shift + F.

    Input: <section class="display-7">

    Find In: Entire Local Site.

    Hit FIND ALL button.

     

    You'll see links to all pages containing that string in your Results panel. 

    Click on each link and edit as needed.

     

    Translate
    Nancy O'Shea— Product User & Community Expert
    Participant
    Jul 15, 2023 7:51 AM UTC

    When I find and replace, it only replaces the text <section class="display-7"> and not the whole section.

    I'll explain what I need with an example:

    Webpage1:

    <section class="display-7"> html code x </section>

    Webpage2:

    <section class="display-7"> html code y </section>

    Webpage 3:

    <section class="display-7"> html code z </section>

    I need to do one find and replace across multiple webpages, looking for code starting with <section class="display-7">   and ending in </section> and replace with <section class="display-7"> html code a </section>

     

    I hope this makes more sense?

    Translate
    osgood_Correct answer
    Legend
    Jul 15, 2023 5:36 PM UTC

    Use the 'regular expression' option in find and replace (see below).

     

    Find:

    <section class="display-7">(.*)</section>

     

    Replace:

    <section class="display-7">Insert whatever content you want, to replace the current content, here</section>

     

    Although I dont use Dreamweaver anymore I'm sure it must have a regular expression option when finding and replacing content, most editors do these days

    Translate