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

HELP WITH GREP Find any text but not inside parentheses

Tagged: ,

Return to Member Forum

  • Author
    Posts
    • #70785

      Hi to all Scripter,
      need your help to find any text (character style) but not inside parentheses.

      I would be hugely grateful for any possible help.
      Many thanks

    • #70857
      Aaron Troia
      Participant

      I’ve been thinking about your questing for a few days now and I think this should find most of the instances of text between closing and opening parentheses, except for the text before the initial opening and the text after the final closing parentheses.

      Find: (?<=\) )(?s:(.+?))(?= \()

      To find the text before the initial opening and after the final closing parentheses:

      Text before opening parentheses: (?s:(.+?))(?= \()
      Text after closing parentheses: (?<=\) )(?s:(.+?))$

      Hopefully those will work for what you are trying to do.

    • #71084
      Matt Mayerchak
      Participant

      If I understand the question, you want to change all text in a given character style, unless it’s between parentheses.

      One way is to duplicate the character style in question, and name it “char style parens”

      Then, you could find all the all the text with the character style that IS inside parentheses, and apply the new character style to it. It should look identical; the only difference will be the style name.

      Then, you can find all the rest of the text with the original character style and it should be what you were looking for.

      I hope that was what you were looking for!

Viewing 2 reply threads
  • You must be logged in to reply to this topic.
Forum Ads