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

Replacing Found Characters in Grep Search

Return to Member Forum

  • Author
    Posts
    • #75898

      Hi, sorry for the noob query and apologies if it has been answered before, but I can’t find it…

      Anyway, I am setting an index and I would like to change the space between the subject and the reference to an em space. For example If the subject is Aardvark and the reference is page one, it currently looks like this:

      Aardvark 1

      I would like it to be

      Aardvark 1

      I can find the space between the subjects and reference by searching for this: “[\u] [\d]”, but if I try and replace it with “$1~m$2” I get “$1?$2” rather than “k 1”.

      Obviously I am a complete dunce when it comes to mathematical search and replace strings and any help would be appreciated.

    • #75899
      Masood Ahmad
      Participant

      Try this:

      Find what: ([\u])( )(\d)
      Change to: $1~m$3

    • #75900

      Thanks!

      I’d just gone through and done the whole index manually. Your formula picked-up and changed the three entries I had missed. Perfect.

    • #75901
      Masood Ahmad
      Participant

      You’re welcome. Anything else I can do for you.

    • #93555
      Clayton King
      Member

      I’m not sure I understand how grep works… I’m laying out a book and the author wants a symbol (image) used as section breaks between some paragraphs. In her word document, she typed “<fleuron>” in a paragraph by itself to indicate where she wants these symbols.

      I’m trying to figure out a way to use grep to change <fleuron> in to something else (i.e., an actual small image or symbols from a dingbat font) throughout the publication. For my life, I can’t figure out how to do it.

    • #93558
      David Blatner
      Keymaster

      Clayton, you probably don’t need GREP for that. If you’re using an image, you could use this trick:
      https://creativepro.com/find-text-change-to-graphic.php

      Or, if the fleuron is a character in a font, it’s even easier with Find/Change.

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