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 search for changing space after endnote number

Return to Member Forum

  • Author
    Posts
    • #1200762
      Chris Vogel
      Member

      I am trying to do a GREP search for finding endnote numbers followed by a period and space, and then replace the period and space with an en space. Several expressions work fine on finding the character string; however, only some of them replace the period and space with the en pace, while the others just add the en space after the period and space.

      (˜U)\.\x{20} and (˜U)\. work fine on both finding and replacing, but yesterday I thought the code for space was \x20. That worked fine for finding but only added the en space without removing the period and space.

      My replacement expression is $1˜>

      Before I run this search on an over 300-page art book, I was hoping someone could explain the different results. Thank you.

    • #14323640
      Aaron Troia
      Participant

      Hey Chris,

      What is happening when you search for \x20 is that you are are telling your GREP to be greedy look for a specific space, in this case it is the one assigned to x20 in Unicode. When you use you are telling GREP to be nongreedy and find any space.

      Aaron

    • #14323638
      Chris Vogel
      Member

      Thank you, Aaron

      I vaguely understand the difference between greedy and non-greedy. But are \x20 and \x{20} the same? If so, why does the latter work for replacing but not the former? Both highlight the same characters in the InDesign file

      chris

    • #14323637
      Aaron Troia
      Participant

      oh ok, sorry Chris, I must not have realized you had one with and one without curly brackets. that makes more sense.

      I just did a search with some Lorum Ipsum and both ways allowed me to find and replace all the spaces and replace them with En Spaces. I’m guessing they’re the GREP search is seeing them as the same (at least on my end) and the GREP search isnt being very strict on format. Again, that’s just a guess.

      I have a few GREP searches for blocks of Unicode characters (Greek [\x{0370}-\x{03FF}] and Hebrew [\x{0590}-\x{05FF}]) and I have them set up with the curly brackets. I havent tried them without the curly brackets, but now I’m curious to see if it would work without them. Though I feel I might have tried without (I put them together awhile ago) and couldnt get it to work with finding a range of Unicode.

    • #14323633
      Chris Vogel
      Member

      Thanks again, Aaron, for spending your time trying to help me.

      Still feel unsettled that I’m getting different results on the replace with finds that highlight the same characters (it’s even worse that you’re getting good results with everything). But since the curly brackets have solved my problems, I’m going to just go ahead and use them.

      By the way, how do you show the handy rectangles around the GREP expressions in your posting?

    • #14323632
      Aaron Troia
      Participant

      No problem Chris, and sorry I couldn’t fully answer your question.

      To get the gray rectangles, I believe you can either wrap your text in <code>your text here</code> tags or wrapped in ` (the key shared with ~)

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