3 Replies Latest reply on Aug 26, 2011 6:34 AM by treesa.c

    GREP styles help. From beginning of paragraph through double space

    treesa.c

      Hello. I am trying to learn how to use GREP styles and I have the basic concept down, but am still struggling with anything other than the very basic codes.

       

      I am designing restaurant menus. I have applied a GREP style to all digits to style my prices. I would now like to apply a style beginning at the start of a paragraph through the first double space...

       

      the basic structure of what I'm styling is as follows

       

      The Dish Title  8.95  the
      description of the food dish follows
      the price and is described here

       

      (I could change the double spaces to an em space if that would make styling it easier in GREP. Like I said, I'm a beginner so I don't know )

        • 1. Re: GREP styles help. From beginning of paragraph through double space
          Joel Cherney Adobe Community Professional & MVP

          I don't know that I'd use GREP for this, myself. There are a few ways - okay, many ways - to do "find all text up to the first double space" the easiest of which is

           

          .+  (period plus space space)

           

          if the spaces you're looking for are normal spacebar-whacks. THis query

           

          .+\s\s

           

          is more greedy; \s is the wildcard for "any whitespace" so it'll find two paragraph returns just as well as it finds two spaces.

           

          But I'd use Nested Styles for this, I think. THat's pretty much exactly what they're for. Nested styles are part of paragraph styling; it automatically applies a character style that you make to all text starting from the beginning of the paragraph up through a character you specify - like, say, a tab, or a colon, or an End Nested Style character. Since your special style-stopper is a double space, and you  can end a nested style on a double space - you can only end the style on a single character. You can either type in your preferred nested-style-ender, or you can choose from the pulldown menu. One of your options there is em dash, so your find/change two spaces to em dash would be a good first step if you did want to use nested styles.

           

          A good reason to not use Nested Styles here is if you needed the style to apply to the dish title no matter where it appeared in the paragraph, e.g. if you wanted to move the dish titles to a point after the prices. Nested Styles are pretty configurable but they are most easily used when they style the first word(s) of a paragraph.

          1 person found this helpful
          • 2. Re: GREP styles help. From beginning of paragraph through double space
            SJRiegel Adobe Community Professional & MVP

            Another way to use nested styles here would be to put a Bold nested style up to any digit, then Italic through one word. This will format the dish name and the price in one step.

            1 person found this helpful
            • 3. Re: GREP styles help. From beginning of paragraph through double space
              treesa.c Level 1

              thank you, both of you.

              Very helpful!