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 style within a paragraph style

Return to Member Forum

  • Author
    Posts
    • #59915
      Anonymous
      Inactive

      I'm trying to create a GREP search to replace out common things that need to be superscripted. This is the expression I put in the GREP style box and applied a character style.

      (?<=m|in|yd|ft|mi)(3|2)

      It works for m3 and m2, but for some reason it won't get the others separated by the | (or) character.

      Previously I listed them as separate GREP styles in the paragraph style, but it seemed to really slow the document down. I could just do a search and replace it with the character style in the past, but I have had a problem in the past with users editing something with the character style and then their whole paragraph ends up in superscript.

      Does anyone have any suggestions?

    • #59916

      It doesn't work because the lookbehind cannot deal with strings of different lengths. That seems to be a limitation of ID's particular GREP handling; this also doesn't allow repetition codes in a lookbehind. (For lookaheads, it seems to work just fine.)

      You could try grouping into sets of same length:

      ((?<=m)|(?<=yd|ft|mi))(2|3)

      (warning: I didn't try this!)

    • #59919
      Anonymous
      Inactive

      Worked like a dream!! Thanks a million!

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