• Wild Card Find & Replace

    Author
    Topic
    #471626

    I have a huge list of glossary. I would like to change the first word (a term) in all paragraphs to Bold & Red.
    All terms end with a colon (:).
    For example:
    Attest: To swear a statement is true.
    Attorney: Also called Lawyer, Counsel. The legal representative of a party at a trial.
    Attorney Client Privilege: The indefinite protection of oral, written, actions or ges­tures of communication between an attor­ney and client…

    Thanks in advance.

    Viewing 4 reply threads
    Author
    Replies
    • #1244005

      Hi armsys,

      You could use:
      Find = (<[A-Za-z ]{1,}:)
      Replace = 1
      and format the replacement bold & red. Do note that this will make the colon bold & red.

      Alternatively, you could use:
      Find = (^13[!:]{1,})
      Replace = 1
      and format the replacement bold & red. Do note that this will make the preceding paragraph break bold & red (but at least that won't show up on the print). It also won't pick up an entry that doesn't follow a paragraph break (eg a glossary entry that occurs immediately after a Section break or a table).

      Cheers,
      Paul Edstein
      [Fmr MS MVP - Word]

    • #1244006

      You can use regular expressions to find text at the beginning of a line, but multiple words is tricky.
      It might be easier to use a macro because the keystrokes are consistent – go to a the beginning of the next line, search for colon, highlight everything back to the beginning of the line, and format.
      We need to know what version of word processor you are running to help with the macro.

      [Edit] Or what macropod said!

      cheers, Paul

    • #1244008

      Hi Macropd,
      It’s a surprise and an honor to receive your reply. I’ve learned a lot from your articles in the past.
      Before receiving your post, I used ^13A*: as the Find string. At least, it works. Yours is more eloquent.

      Hi Paul,
      Thanks for your help.

      Armstrong

      • #1244123

        It’s a surprise and an honor to receive your reply. I’ve learned a lot from your articles in the past

        Armstrong

        You’re welcome.

        Cheers,
        Paul Edstein
        [Fmr MS MVP - Word]

    • #1244013

      You should give macropod a thumb up for such an excellent reply.

      cheers, Paul

    • #1244020

      Hi Paul,
      Thanks for your reminder. Of course, I’m delighted to do so.
      Thanks, Paul.
      Armstrong

    Viewing 4 reply threads
    Reply To: Wild Card Find & Replace

    You can use BBCodes to format your content.
    Your account can't use all available BBCodes, they will be stripped before saving.

    Your information: