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 character replace

Return to Member Forum

  • Author
    Posts
    • #57332
      wardsdesign
      Member

      Is there any way to use a GREP style to replace one character with another? I'd like to automatically replace any hyphen in a Paragraph style with an en dash.

    • #57346
      Anonymous
      Inactive

      GREP stands for Genearlised Regular Expression Parser

      Or to put it in plain English – it means it finds patterns of text.

      A character or paragraph style can only apply a specific style – like bold, italic, point size, leading, horizontal/vertcial scales etc.

      So you could do a GREP style to find all hyphens and then horizontally scale the hyphen to make it look like a En Dash – but it wouldn't be right.

      But a GREP style would not be able to replace any text with anything else.

      What you could do is create a GREP style to give the Hyphen a highlight style so that they are easily visible on each page and you can adjust each by hand to make then En Dashes.

      BUT:

      If you use Find/Replace you can find a pattern of text – that is a hyphen and then replace it with an En Dash

      InDesign comes prebuilt with GREP exactly for Finding/Changing this.

      Usually I input all the text and then use GREP to find all dashes and change to en dash.

    • #57378

      Any and all hyphens to an en-dash? Surely not?

      Would you change them in all of the following cases?

      1. mother-in-law
      2. 19th- and 20th-century
      3. Januari-March
      4. Call Us On 555-4800-DITTO!
      5. ISBN: 98-90-111-2160-5
      6. self-afflicted
      7. ISO 646-compliant
      8. co-ordinate
      9. brain-blood barrier
      10. a bad-hair day

      (In this list there are only two instances where I would find it mandatory to change the hyphen to an en-dash. In all other cases I feel it's mandatory not to.)

      (Edit — you can add “en-dash” as #12 :) )

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