7 Replies Latest reply on Oct 4, 2012 7:48 AM by winterm

    GREP search AND change in Paragraph Styles

    Airbrush Level 1



      Is it possible with GREP in Paragraph Styles to both find AND change at the same time?


      I´ve got for ex a number 0000000 that i can find in search and replace through

      (\d\d)(\d\d\d)(\d\d) and replace with

      $1 $2 $3 wich of course outputs 00 000 00.


      Is this possible to do with a paragraph style instead?

        • 1. Re: GREP search AND change in Paragraph Styles
          winterm Level 5

          In short - no. With styles you can just change the attributes, not content. Using grep in find/change and including in para style pursue different tasks.

          Think about grep, included in para style, as a smart, advanced way of applying existing char styles. No less, no more.

          • 2. Re: GREP search AND change in Paragraph Styles
            [Jongware] Most Valuable Participant

            If you want to add spaces, so the text can be broken between the digits, then No. As winterm says, you cannot change text with a GREP style.


            If you only want to add a bit of space, such as with manual tracking, then Yes. Create a character style "addSpacing", set its Tracking to +250 (which amounts more or less to a single small space), and add the following GREP styles.



            • 3. Re: GREP search AND change in Paragraph Styles
              winterm Level 5

              yeah, that means: "format your existing content" in some special way...

              • 4. Re: GREP search AND change in Paragraph Styles
                winterm Level 5

                ...and one possible drawback here.

                Imagine, you worked hard on a text, numerous corrections/editions done directly in layout. Finally job is printed/published/whatever.  A few days later client asks you for that "latest and greatest" version of text - he needs it for other projects, in rtf or plain text (real life story). No problem here - you export text story (stories) from ID and... oops. All your tricky "spaces" are gone. It might be beyond client's understanding, why content changed.


                Personally I enjoy using grep in para styles (some people say - overusing...). However, in this particular case I'd stay with safer Find/Change option.


                Please do tell me someone I'm wrong here...

                • 5. Re: GREP search AND change in Paragraph Styles
                  Colin Flashman Adobe Community Professional

                  Agree with Jongware's approach if this is only to adjust the appearance in InDesign, and heed winterm's warning about the client wanting the text for other projects.


                  GREP styles can't ADD content which wasn't there, only change its appearance.

                  • 6. Re: GREP search AND change in Paragraph Styles
                    Jump_Over Level 5


                    I wouldn't like to start an academic discussion, but...

                    If "00 00 000" is a content, so "backspaces" supposed to be pushed during typing.

                    If "0000000" is a content - all the rest is formatting.

                    Imagine another client, who needs a content in this meaning, so all "tricky" spaces suppose to be removed... and oops. If your spaces came from Find/Change - you are in front of pretty huge challenge to step back with this and you can never be sure you reach the exact start point.


                    So, I am not telling you're wrong, but I can't tell you're right also.

                    • 7. Re: GREP search AND change in Paragraph Styles
                      winterm Level 5


                      I believe even the term "grep style" is pointless and may lead to certain misunderstanding. There's no such thing. It's just a smart feature of para style, ability to apply char styles somewhat "automagically". Nobody asks if he could change text content by applying character style...



                      if client wants "00 00 000" in his text, I doubt he'll ask it without spaces for another project. Project may be another, but client is the same

                      "Pretty huge challenge to step back" ? Huh, just another grep query...

                      However, you're right - it becomes just guessing.