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

Losing one's grep (sometimes)

Tagged: 

Return to Member Forum

  • Author
    Posts
    • #69447

      I’ve been learning grep, but need some help.

      I often use this sort of thing in my documents:

      Scooba-doo and scooba-die (Figure 3), that chicken’s (Figure 12) not too young to fry.

      and want the “Figure 3”, but not the parens, bolder
      I learned that the character style would be applied to the string

      (?<=\()Figures?\d+?(.+?)?(?=\))

      But how would I exclude any words or symbols after the word “Figure”?

      Life is real (Figures 3 and 4), life is earnest (Figures 12, 15), if you’re cold, turn up the furnace (Figures 2-19).

      I want “Figures 3 4 12 15 2 19 ” bold, but not the parens or the words/symbols “and , -”

      Thanks!

    • #69666
      Holly Blake
      Member

      Hiya,

      Don’t know if this is too late for you but you can use this expression:

      (?<=\().+?(?=\))

      taken from this page:
      https://creativepro.com/favorite-grep-expressions-you-can-use.php

      which will find any text inside parentheses, but not including the parentheses.

      In your paragraph style go to the GREP style tab and add a new GREP style. In ‘Apply style’, add a bold character style and in ‘to text’, put the expression above.

      Tada!

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