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

GREP Style for end of paragraph word OR after character

New Here ,
Apr 23, 2024 Apr 23, 2024

I am horrible with coding (GREP).

Would anyone know how to either make this text (sale price) be applied with a character style? When I go to apply a Paragraph style, I either the ending word of the paragraph to have a style, or have it to run after a certain character. I'll include the attachment of how I want it (circled text). After all, I am horrible with coding. Maybe I can learn something!
Thanks!

Capture.PNG

TOPICS
How to , Print , Scripting
335
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 , Apr 23, 2024 Apr 23, 2024

\$\d+?\.\d{2}

 

It's all wild cards

\$ is a dollar sign the slash 'escapes' the $ which is used for signaling other thing with GREP - so basically means $ literally

\d is a digit

. on it's own is any character - so \. where the slash escapes the . means the actual dot

\d is a digit

{2} is two times

 

In the item code  paragraph style - go to the GREP Nested Style

Insert the code

Select the Character Style for price - if you don't have you you can create one there.

 

https://redokun.com/blog/grep-indesign

...
Translate
Community Expert ,
Apr 23, 2024 Apr 23, 2024

\$\d+?\.\d{2}

 

It's all wild cards

\$ is a dollar sign the slash 'escapes' the $ which is used for signaling other thing with GREP - so basically means $ literally

\d is a digit

. on it's own is any character - so \. where the slash escapes the . means the actual dot

\d is a digit

{2} is two times

 

In the item code  paragraph style - go to the GREP Nested Style

Insert the code

Select the Character Style for price - if you don't have you you can create one there.

 

https://redokun.com/blog/grep-indesign

 

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 ,
Apr 23, 2024 Apr 23, 2024

Eugene, looks like you have an extra { before the two...

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 ,
Apr 23, 2024 Apr 23, 2024
Thanks, fixed.
It takes a village 
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 ,
Apr 24, 2024 Apr 24, 2024
LATEST

Wow! Thank you. It makes sense after your explanation. Appreciate your help and it works perfectly!

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