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

GREP help

New Here ,
Sep 14, 2021 Sep 14, 2021

Since it seems to be a known issue that Title Case doesn't ignore prepositions, I was able to find a GREP style that fixed this. However, I need to take it one step further. I need to have it stop after the first period in the sentence and go back to the normal or original style??? Help if that makes sense.

TOPICS
How to
402
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 ,
Sep 14, 2021 Sep 14, 2021

Please share the grep style string you are using so that someone can try extending it if possible or maybe give a find/change alternative to it.

-Manan

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
New Here ,
Sep 15, 2021 Sep 15, 2021

With the character style being ALL CAPS

To Text: :\s\l|[-\s]\l(?!(f|s|he|nd?|o|y|rom|or)?\b)

This works for the entire line, but what I want is it to only be up to a point. In this case, a period.

 

The above seems to be pretty good for correcting the Title Case for InDesign.

 

Example: This is What I Want. It should look like this.

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 ,
Sep 15, 2021 Sep 15, 2021

does adding \.  (backslash period) to the end do what you want?

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
New Here ,
Sep 15, 2021 Sep 15, 2021

It doesn't seem to to what I want.

 

Also, to take my example a step further...

 

Ex: This is What I Want. It should look like this. And this should continue.

 

Does that make sense? I want it to be Title Case up to the first period (with my corrections for prepositions) and then Sentence case for the remainder of the paragraph.

 

By the way, I am NO GREP expert. So if you can point me to something that will help me get better, that would be great as well.

 

Thanks!!!

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 ,
Sep 15, 2021 Sep 15, 2021

OK, I ran the expression on some sample text and see why that suggestion didn't work. I was thinking maybe a nested style to assign title caase for the first sentence, combined with a GREP style to fix the prepositions, but there is no option to use title case in style definitions, so that's a dead end.

Afraid I don't have an answer at the moment.

As for GREP learning resources, I highly recommend Peter Kahrel's book Grep In InDesign. https://www.amazon.com/GREP-InDesign-InDesignSecrets-Peter-Kahrel/dp/0982508387

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
New Here ,
Sep 17, 2021 Sep 17, 2021
LATEST

Thanks for the help and guide to other resources!

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