Skip to main content
Participant
July 14, 2023
Answered

Find a section of code

  • July 14, 2023
  • 1 reply
  • 311 views

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 has been closed for replies.
    Correct answer osgood_

    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

    1 reply

    Nancy OShea
    Community Expert
    Community Expert
    July 14, 2023

    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.

     

    Nancy O'Shea— Product User & Community Expert
    Participant
    July 15, 2023

    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?

    osgood_Correct answer
    Legend
    July 15, 2023

    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