Search for Asterisk & text

Learn / Forums / General InDesign Topics / Search for Asterisk & text

Viewing 2 reply threads
  • Author
    Posts
    • #90295

      I have a client that sends me a word document with hundreds of names that are called out like so: *Firstname Lastname*
      She does this so that we know to bold the name that is surrounded by asterisks.

      Is there a way to search for the asterisk with Find/Change in InDesign? Or, even better, is there a way to search the whole thing, and remove the asterisks after I’ve changed the name to bold?

      Right now I can’t even figure out how to search for an asterisk, so any help would be much appreciated. Thanks.

    • #90299

      Ok, I have figured out how to search for the phrase. Right now I am using \*[^*]+\*

      But I still don’t know how I could automatically get rid of the asterisks after finding them and styling the text within them. Right now I am still doing that manually. Can anyone assist me with this?!

      • #90300

        I tried a simple experiment that seems to work.

        The first thing I did was make a bold style sheet.

        I then went to find and change and clicked on the grep tab. I searched for the string you put in. I then went to replace and selected my bold character style sheet. Replaced all.

        I then deleted both the search and find fields in the grep area.

        Then I clicked on regular search and replace “text” tab.” And searched for an asterisk and replaced with nothing.

        Then replaced all.

        NOTE: This was just searching and replacing, and not a grep thing to do automatically if new files are imported into the same file.

        Just a basic search and replace of a few steps.

    • #90308
      David Blatner
      Keymaster

      This article might help: https://creativepro.com/findbetween-a-useful-grep-string.php

      But in general, I would just search (in the grep tab) for \*(.+?)\* and then replace with $1 and set it to bold.

      • #90338

        ^^Does that delete the asterisks as OP wanted?

      • #90348
        David Blatner
        Keymaster

        Yes, it should. The code means “search for an asterisk followed by some text followed by an asterisk” and then $1 means “replace it with just the text”

      • #90353

        Very impressive, David. I just tried a test and it worked perfectly!

      • #92400

        This worked perfectly… thank you so much David! You are a life saver!

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