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 for a.m. or p.m. and fix to en dashes

Return to Member Forum

  • Author
    Posts
    • #77345
      Cindy Kelley
      Participant

      I think this is an easy GREP … except for me. :) I tried creating it yesterday but didn’t trust my results.

      I want to replace all spaces in times to a non-breaking space and fix incorrect dashes

      My client wants but their various writers use all sorts of formatting

      1–2 p.m.

      I want to fix
      remove the times with the :00
      the dash as some size other than an en dash. The always want en dashes. Is it possible to create a non-breaking en dash?
      no spaces around the en dash
      add a non-breaking space before a.m. and p.m. so they stay with the number

      Thanks in advance geeksters :)

      Cindy

    • #77395
      Henk Vrugt
      Participant

      find (\d{1,2})(?::00)??(~m|~=|-)?(\d{1,2})(?::00)?(?:)([ap]\.m\.)
      change $1~=$3~s$4

      This will do the trick, I suppose

    • #77399
      Henk Vrugt
      Participant

      Oh, I forgot:
      apply a non-breaking caracter style to it and that problem is solved as well!

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