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 Code applying superscript only to 1 or 2 letters

Return to Member Forum

  • Author
    Posts
    • #14394652
      Dylan Van Elewyck
      Participant

      Hello,

      I hope someone can help me with the following.

      I am looking for a GREP Code in which it is possible to achieve this:
      “no. 123” to “no 123” and “nos. 123” to “nos 123”

      Just to clarify, in the letters “no” and “nos”, only the “o” and “os” may be converted to (open-type) superscript.
      And the dot has to be deleted and and the subsequent numbers should be retained.

      Thank you very much.

      Kind regards,
      Dylan

    • #14394653
      Dhafir Photo
      Participant

      Use this:
      in Find: \<n\K(os?)\.?
      in Change: $1
      in Change Format: Open type superscript

    • #14394654
      Dylan Van Elewyck
      Participant

      Hello,

      Thank you for your reply. But in this case the code is looking for all the letters ‘o’, and it should only change the ones followed by a number. How can this code be adjusted?

      Thank you very much.

      All best,
      Dylan

      • #14394655
        Dhafir Photo
        Participant

        Sorry i forgot the second part of the regex!
        Use this:
        in Find: \<n\K(os?)\.?(?=\d)

    • #14394656
      Dylan Van Elewyck
      Participant

      Thank you very much!

      All best,
      Dylan

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