Back

If your email is not recognized and you believe it should be, please contact us.

  • You must be logged in to reply to this topic.Login

Apply Character Style to all Digits After First Sentence

Return to Member Forum

  • Author
    Posts
    • #80903
      Anonymous
      Inactive

      Hi,

      I’m looking for a way to apply a character style to all digits in a paragraph EXCEPT digits in the first sentence. I’m assuming I should use a GREP style, but I’m having trouble getting it to work. I tried (?<=\.)\d+ without success.

      Thanks in advance for your help!

      Best,
      Justin

    • #80907
      Peter Kahrel
      Participant

      You’ll have to do it in two steps (that is to say that that’s the only way I can get it to work):

      1. Apply the character style to all digits in the paragraph
      2. Apply the character style [None] to ^.+?\.

      If you want to do that in a GREP style, bear in mind that [None] doesn’t have the same effect as applying it normally, outside a GREP style: it does nothing at all. Create a character style Black, set its colour to Black and use it instead of [None].

      Peter

    • #80908
      David Blatner
      Keymaster

      I was about to write a possible answer, but then I saw who replied (Peter K) and laughed, thinking, OK, if The Master says it has to be done in 2 steps, then that’s good enough for me. :-)

    • #81175
      Anonymous
      Inactive

      Thank you! That seems to have done the trick.

Viewing 3 reply threads
  • You must be logged in to reply to this topic.
Forum Ads