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

GREP with character styles ? start/end of range

Return to Member Forum

  • Author
    Posts
    • #58629

      If you run a GREP search with a character style specified in the Find options, then $ no longer means 'end of paragraph', but instead means 'end of style range'. But ^ still means 'start of paragraph'. Is there another code that means 'start of style range'?

      What I'm looking for is, in a text string such as

      Blah blah blah blah 54 blah blah blah blah aardvarks 234 blah blah blah blah stingray 56 blah blah blah 95 blah blah.

      to match the numbers that appear in italics on their own, and not the ones preceded by a word in italics. Is this at all possible? I know that GREP assumes that anything in a look-before or look-ahead must have the same formatting specified in the Find options, so I could easily find 234 in 'aardvarks 234' but not 54 on its own, but how do I do it the other way around?

    • #58631

      (?<!.)d+(?!.)

      There is a caveat emptor with this; it assumes the spaces between your “aardvarks” and “234” are also italics; if not, this GREP will find the number, because it's a number in italics without anything before or after (in italics).

    • #58643

      Excellent, that works wonderfully. Thanks yet again!

Viewing 2 reply threads
  • The forum ‘General InDesign Topics (CLOSED)’ is closed to new topics and replies.
Forum Ads