1 Reply Latest reply on Oct 1, 2013 1:01 AM by David_Powers

    using regular expressions

    zimtheinvader

      I need advice on using regular expressions.

       

       

      What I want to do is change:
      "Genuine Honda Odyssey Seat Covers for the 2nd row." to
      "Genuine Honda Seat Covers for the 2nd row for Honda Odyssey."

       

      But there are hundreds of different lines in the same format just with different words after "Genuine Honda Odyssey" and before the "."

       

      It would be easy to just have it drop the Odyssey from the line but having it add "for Honda Odyssey" at the end of each of those lines is the tricky part.  I need a way to tell it that if the line starts with "Genuine Honda" and ends with "." to make it start with "Genuine Honda" and end with "for Honda Odyssey." while leaving the text between alone.

       

      can that be done?

       

      I've read the tutorial at: http://www.adobe.com/devnet/dreamweaver/articles/regular_expressions_pt1.html  and my head feels about like it wants to explode.

       

       

       

      ---------------

      update: I should have had more faith in myself. 

       

      This worked:

       

      FIND:

      \>Genuine Hond[^a]*a([^.]*)

       

       

      REPLACE WITH: 

      \>Genuine Honda $1 for Honda Odyssey

        • 1. Re: using regular expressions
          David_Powers Adobe Community Professional (Moderator)

          You don't actually need a regular expression to do that. Just search for the existing phrase, and replace it with the revised phrase.

           

          However, if you want to feel particularly smart doing it with a regular expression, search for this:

           

                (Genuine Honda )Odyssey (Seat Covers for the 2nd row)

           

          Replace it with this:

           

                $1$2 for Honda Odyssey

          1 person found this helpful