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

☺ Just another GREP question

Guest
Jun 28, 2017 Jun 28, 2017

Copy link to clipboard

Copied

Hello,

Question 1

I want to create a GREP rule for formatting words and chains of words that start with the same word, and have dots and space !

Please...

[Please dot dot dot]

and

Please... Let Me Go

[Please dot dot dot space Let Me Go]

I have tried this formula :

Please\.\.\.|Please\.\.\. Let Me Go

but it doesn't work the "Let Me Go" is not detected by my GREP rule.

---

Question 2 (Homonyms problem)

Once the GREP formatting has been applied, is it possible to exclude a word from the GREP formatting ?

(...with a magic trick !)

Example : Let's say I am writing an essay about The Beatles, and I have made a GREP rule for all the songs titles.

My problem is that some titles are very common words in English :

Because

Boys

Girl

Goodbye

I will

Shout

Wait

Yesterday

Woman

...words that I will also use many times in my essay. Any ideas ?

Thank you very much

Views

238

Translate

Translate

Report

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 , Jun 28, 2017 Jun 28, 2017

1. It's because the first GREP half already matches, so why would the computer search again? Make the second part optional – GREP is greedy by default, and so it will match the entire string if possible:

Please\.\.\.( Let Me Go)?

(Also, consider using a proper ellipsis instead of dot-dot-dot. Available in most fonts ... and usually drawn nicer than three regular dots … [it may or may not be visible but the first ellipsis in that sentence is 3 full stops, the second one is a “proper” ellipsis]. The

...

Votes

Translate

Translate
Community Expert ,
Jun 28, 2017 Jun 28, 2017

Copy link to clipboard

Copied

1. It's because the first GREP half already matches, so why would the computer search again? Make the second part optional – GREP is greedy by default, and so it will match the entire string if possible:

Please\.\.\.( Let Me Go)?

(Also, consider using a proper ellipsis instead of dot-dot-dot. Available in most fonts ... and usually drawn nicer than three regular dots … [it may or may not be visible but the first ellipsis in that sentence is 3 full stops, the second one is a “proper” ellipsis]. There is a default hotkey to enter them – Alt+; – and its associated GREP code is ~e.)

2. You can stack GREP styles, as the lower ones will override those higher up, and you can also manually override your formatting. Please reconsider doing it this way. You are probably far better off with creating a separate character style for "Song title", and applying it manually where needed only.

Votes

Translate

Translate

Report

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
Guest
Jun 29, 2017 Jun 29, 2017

Copy link to clipboard

Copied

LATEST

Thank you for your quick reply , you're a lifesaver.

I think that formatting the words only at the beginning of paragraphs will do the job :

^Please\.\.\.( Let Me Go| Do No Touch)?

Votes

Translate

Translate

Report

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