GREP Expression Help

Learn / Forums / General InDesign Topics / GREP Expression Help

Viewing 4 reply threads
  • Author
    Posts
    • #74916
      P. Ahmed
      Member

      Hello folks,

      I need help with a GREP expression. I’m using the following expression to find everything between parentheses: \(.+?\)

      What I want to do is one of the following two things but I need both expressions so then I can choose which one I want to keep. I want to replace it by leaving the text in between the brackets but removing the brackets themselves, and another expression to replace the round brackets with square ones, in both cases the text is to be left as it is.

      Thank you.

    • #74919
      Aaron Troia
      Participant

      “I want to replace it by leaving the text in between the brackets but removing the brackets themselves,”

      Find: \(([^)]+)\)
      Replace: $1

      “and another expression to replace the round brackets with square ones, in both cases the text is to be left as it is.”

      Find: \(([^)]+)\)
      Replace: [$1]

      As you can see its the same GREP search, the only thing that changes is what you are putting in the replace field.

    • #74920
      P. Ahmed
      Member

      Amazing, worked a treat, many thanks.

    • #74921
      Aaron Troia
      Participant

      oh good, I’m glad I could help.

    • #74985
      Masood Ahmad
      Participant

      Good one Ron.

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