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 underline

Return to Member Forum

  • Author
    Posts
    • #62410
      Gert Verrept
      Member

      Hi,

      Can someone help me figuring this grep out? I want to get to this result:

      Art. 15 (vroeger art. 14)

      Starting point: Art. 15 14

      The grep I made gives me the correct sentence, but the underscore is missing. Can this be done in one grep or not?

      the Grep: Find panel (Art. )(d+)(d+) in the change panel: $1$2(vroeger art. $3)

      gert

    • #62412

      You must have forgotten to set Underline on in the Change To format. How do I know? Because if you had, you'd have another problem — the entire string would be underlined! You cannot set some sort of formatting to just “apply to $2″ — formatting in the Change To field is always applied to all of the text in it.

      In addition, you should try to avoid changing text if all you need is change formatting. Leave the Change To text field blank and make sure the Find field only “finds”, i.e. selects, what you want to format.

      So how to do that? Since you want to do 2 different things, there is no other option than doing one at a time. First, add the extra text, which you got covered. (But the period is a “wild card” character in Find. You need to escape it with a backslash to make sure it only matches actual periods.)

      Then use Lookbehind/Lookahead, like this:

      (?<=^Art. )d+(?= (vroeger)

      and put just Underline in Change To. This looks for digits that are preceeded by “Art.” and followed by ” (vroeger”. Since the parenthesis is also special in a Find GREP, it again needs an escape.

      If you do a Find Next, you will see this will highlight only the digits, and it'll be safe to change all.

    • #62416
      Gert Verrept
      Member

      Thnkx a lot, Jongware. I figured he first part out too (setting the Underline) underlines the whole thing.

      Making a para style with nested styles didn't work out, because some digits don't need underline, those which are not followed by (vroeger art….). So thankx again for the quick answer and solution.

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