5 Replies Latest reply on Oct 9, 2012 3:35 PM by Peter Spier

    GREP to select only lowercase up to an em-space | Complex nested styles


      I'm attempting a complex grep search in combination with a nested style. I'd like to apply a nested style up to an em-space (that's easy, and I've been successful.) but then I need to apply a GREP to only the lower case preceding the em-space, and that is proving difficult or impossible. Can you shed some light?


      I'm building paragraph and character styles for a book. Our 4-heads appear in two styles: 1) On a line by itself, and 2) as a run-in to a text paragraph. the line by itself poses no problems, and the para-style and nested char-styles apply the small caps with no interaction needed. The small caps are defined as a char-style 85% of vert/horiz sizing so that we maintain control over sizing; to use the applications preferences could introduce multiple small cap sizes with multiple people doing the layout work.



      When I get the the run-in version (shown above without the small caps applied) I can use nested styles to apply the bold italic, but then I have to be able to selectively apply the small caps. I intended to accomplish this by then using a GREP style to select only the lower case letters from start of paragraph to the em-space, but am struggling to acheive.

      • Using a positive lookbehind, I can select the \l+ in the one word immediately preceding the em-space, but not on ALL words preceding the em-space.
      • Using a repeating nested style, I can ignore the first letters of each word, but then this continues beyond the em-space.


      Is there a GREP that can do the following?

      Beginning with the new paragraph     ^

      select only lowercase characters     \l+

      and apply a character style

      ending at the first em-space


      Or am I stuck doing a find/change (which is only semi-automated)?