Changing formatting between marks/codes

Learn / Forums / General InDesign Topics / Changing formatting between marks/codes

Viewing 7 reply threads
  • Author
    Posts
    • #69811
      Dianne Yusko
      Member

      Need to run find/change and make the text assume the formatting between the marks/code in my index.


      @8
      :<I>Aggression, the Crime of Crimes<$>

      The text between the code needs to be italic

      How do I do that for any index.

    • #69817
      enDash
      Member

      This sounds like a job for GREP Styles, something like this: https://creativepro.com/findbetween-a-useful-grep-string.php perhaps?

    • #69822
      Eugene Tyson
      Member

      This is how I would write it

      (?<=@8:<I>).+(?=<\$>)

    • #69824
      Eugene Tyson
      Member

      (?<=@8:<I>).+?(?=<\$>)

      This is better

      • #69841
        Dianne Yusko
        Member

        This one worked!!!!! Thanks SO MUCH!!!!!

    • #69825
      Eugene Tyson
      Member

      (?<=) is a positive lookbehind – which means it will look behind what you’re searching for but it won’t include it in the result

      Inserting the text you want it to look behind would be @8:<I>

      Therefore it’s

      (?<=@8:<I>)

      Adding .+? after this means it will select all the next lot of text zero or 1 time only

      <if you only had .+ it would keep on searching right to the end>

      (?=) is a positive lookahead – it will look ahead but won’t include it in the search results.

      <adding in <$> wouldn’t work because $ is GREP code for finding at the end of a paragraph>

      Therefore we need to “escape the $” and we do this by adding a “\”

      <\$> makes it search for a $ in the text.

      Resulting in

      (?<=@8:<I>).+?(?=<\$>)

    • #69827
      David Blatner
      Keymaster

      I would just do a find/change like this:

    • #69833
      Eugene Tyson
      Member

      Interesting – that’s not working for me in CS5.5

      Must move on to CC 2014 soon.

    • #69840
      Dianne Yusko
      Member

      Thanks David, but it didn’t work for me. I am changing the formatting not the characters/words. The words between the <I> and <$> need to be italic and take on a style from my style guide.

Viewing 7 reply threads
  • You must be logged in to reply to this topic.
>