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

Tagged: 

Return to Member Forum

  • Author
    Posts
    • #70759
      bt
      Member

      Hi, if anyone has the time, could you possibly help me out with GREP? I need something very simple: Find all text within parens, and apply italic attribute.

      That would be great, but there is a possible refinement that would also help.

      These strings between Parens also contain names styled with a character style for small caps that simply changes the font to an old-fashioned smallcaps format font. If possible, I would like text with this character style to be left alone – – that is, for no attempt to be made to italicize it.

      I would be hugely grateful for any possible help.

      Many thanks,

      Bill

    • #70761
      Aaron Troia
      Participant

      You are going to need to run two Regex’s for what you are asking, as Character Styles over ride each other and there is no Grep for excluding Smallcaps. you might need to temporarily add something unique to one or both sides of the small caps so that you can identify the strings of Smallcaps in your Grep searches, and then strip them out when you’re done.

      Here is a Regex to change everything in parens to italic:
      Find What: (?<=\()(.+?)(?=\))
      Change to: $1
      Find Format: [Leave Blank]
      Change Format: Your italics character style

    • #70767
      David Blatner
      Keymaster

      Here’s a write-up of which styles override which:
      https://creativepro.com/when-character-styles-collide.php

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