1 Reply Latest reply: Dec 15, 2010 3:49 PM by CharlesBelov RSS

    Matching across line breaks in source find & replace

    CharlesBelov Community Member

      Given sample code on three lines, with no trailing whitespace:   01301 RETIRE CITY MISC  I would like to change it to   01301 RETIRE CITY MISC  and make similar changes to all other such occurrances across many files.  I tried Find & Replace, Source code, Use regular expressions with the following:  From: \n([^<]*)\n([^<]*)  To: \n\1 \2  and Dreamweaver found no matches. I also tried with \n\r instead of just \n, with the same results. How can I match across the line breaks?

        • 1. Re: Matching across line breaks in source find & replace
          CharlesBelov Community Member

          Corrected post:

           

          Given sample code on three lines, with no trailing whitespace:

           

          <TR >
          <TD >01301</TD>
          <TD >RETIRE CITY MISC</TD>

           

          I would like to change it to

          <TR >
          <TD >01301 RETIRE CITY MISC</TD>

          and make similar changes to all other such occurrances across many files.

          I tried Find & Replace, Source code, Use regular expressions with the following:

          From:

          <TR >\n<TD >([^<]*)</TD>\n<TD >([^<]*)</TD>

          To:

           

          <TR >\n<TD >\1 \2</TD>

          and Dreamweaver found no matches. I also tried with \n\r instead of just \n,  with the same results; escaping the < > and / didn't help either. How can I match across the line breaks?