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

Apply a character style to text that appears within parentheses

Participant ,
Jul 31, 2024 Jul 31, 2024

Hello. I've tried this (https://community.adobe.com/t5/indesign-discussions/grep-query/m-p/14365227) for applying a character style to text within parentheses but must not be changing the correct portion of the string to ( ). 

TOPICS
How to
2.3K
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 , Jul 31, 2024 Jul 31, 2024

Hi @Parny:

 

Nevermind! I see the issue. The OP was targeting text within brackets. You are targeting text within parentheses.

 

This would do it: \(\K[^\]]+?(?=\))

 

2024-07-31_09-11-49.png

 

But: you want to include the parentheses., so

\(.+?\)

 

2024-07-31_09-16-23.png

 

Since this is an entirely different question, I'm going to move it to its own thread.

 

~Barb

Translate
Community Expert ,
Jul 31, 2024 Jul 31, 2024

Can you share a screenshot that includes the GREP style and the result?

 

~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
Participant ,
Jul 31, 2024 Jul 31, 2024

Hi Barb. No result yet. Kept saying no instance exists to find. Please see screenshots. I want to change the pink bold text in parentheses to the light black text, with the GREP string applying that set character style.

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
Participant ,
Jul 31, 2024 Jul 31, 2024

Or is it a Find/Change string, not using the GREP window?

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
Participant ,
Jul 31, 2024 Jul 31, 2024

I was trying the string \[\K[^\]]+?(?=\]), which was in a discussion early this year.

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 ,
Jul 31, 2024 Jul 31, 2024

You can do with the a GREP style but these strings can be tough to troubleshoot: could you show your GREP as is appears in the style options dialog box? (Not copy/paste the string here?)

 

~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
Community Expert ,
Jul 31, 2024 Jul 31, 2024

Hi @Parny:

 

Nevermind! I see the issue. The OP was targeting text within brackets. You are targeting text within parentheses.

 

This would do it: \(\K[^\]]+?(?=\))

 

2024-07-31_09-11-49.png

 

But: you want to include the parentheses., so

\(.+?\)

 

2024-07-31_09-16-23.png

 

Since this is an entirely different question, I'm going to move it to its own thread.

 

~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
Participant ,
Jul 31, 2024 Jul 31, 2024

Barb, thanks for your help. I'm not handling this correctly still. I guess I didn't place \(.+?\) in its correct place in the string?

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 ,
Jul 31, 2024 Jul 31, 2024

Can you share your Paragraph Styel Options > GREP Style screenshot?

 

~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
Participant ,
Aug 01, 2024 Aug 01, 2024

Here is a page on which I changed the instances from pink bold to black light yesterday before stopping to post here. I so appreciate your stopping to help. By the way, could you recommend a particular resource to learn about GREP characters and groups? or whatever they are called.

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 ,
Aug 08, 2024 Aug 08, 2024

Yes, I highly recommend purchasing a copy of Peter Kahrel's book: GREP in InDesign. 

 

~Barb

 

https://www.amazon.com/GREP-InDesign-InDesignSecrets-Peter-Kahrel/dp/0982508387/ref=sr_1_1?crid=1L27...

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
Participant ,
Aug 13, 2024 Aug 13, 2024
LATEST

Many 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