Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

How to tell GREP to find specific text?

Contributor ,
Feb 22, 2019 Feb 22, 2019

I'm using a piece of text throughout an article I am writing and I would like all instances of it to have a specific character style. This is the text, including the elipses:

(PHOTO-TIP)

I have already created a character style to make it yellow.

In the GREP panel of my Paragraph style, I added a new GREP (I already have another GREP for widows) and told it to select the character style I created. I just don't know how to configure the GREP. Here is what I've done so far, I hope I got something correct:

~e~uPHOTO-TIP~e

I think what I told it to do above is to:

Look for Elipses

Look for Custom Text

PHOTO-TIP

Look for Elipses

Screen Shot 2019-02-22 at 9.55.41 AM.png

945
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Community Expert , Feb 22, 2019 Feb 22, 2019

\(PHOTO-TIP\)

Translate
Community Expert ,
Feb 22, 2019 Feb 22, 2019

\(PHOTO-TIP\)

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guide ,
Feb 22, 2019 Feb 22, 2019

Sorry but I'm not sure I understand what you mean by elipses? Did you mean round brackets/parenthesis?

~e refers to ellipses (serie of three dots: …)

~u refers to custom text variable. Is your text a variable? Or is it just "regular" text?

If so, just try:

\(PHOTO-TIP\)

By default, regex is case sensitive. So if you want to catch (Photo-Tip) or (photo-tip), just add (?i) before:

(?i)\(PHOTO-TIP\)

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Feb 22, 2019 Feb 22, 2019

Your logic is good (though you don't need the ~u) but those are parentheses and not ellipses.

~Barb

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Contributor ,
Feb 22, 2019 Feb 22, 2019
LATEST

Yea, I meant Parens. Mornings don't agree with me. This works, thank you very much.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines