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 txt in italic

Return to Member Forum

  • Author
    Posts
    • #58224
      Gert Verrept
      Member

      This is my question:For governmental documents, I made a grep search which puts all the “bis”, “ter”, etc after a digit (article 8bis become article 8bis) by giving it a charstyle “italic” this is the grep: find (?<=d)(bis) change box empty but charstyle “italic”. So far so good, but if the text is in italic, then the “bis” should NOT be put in italic (ex. article 8bis has to become article 8bis). Can this be done in a grep search or not?

      Simply put: search for all instances of a digit followed by “bis”, “ter”, “quater” and put them into “italic” unless the digit is already in italic then is has to be set “roman”

      gert

    • #58226

      There is no “unless” or “otherwise”, option you will have to do the S&R in two steps.

      First search for this:*

      (?<=d)(bis|ter|quater)b

      and specify “Regular” in the Find formatting; put your italics char style in the Change To formatting field.

      Then make a new char style “Regular”, and this time look for Italics in the Find formatting. It will work, not picking up any of the texts you replaced above with italics, because of this little GREP Gripe!

      (* See how you can do lots of searches in one go? The b End-of-Word code at the end assures it won't pick up anything nasty.)

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