Grep style

New Here ,
Feb 10, 2021 Feb 10, 2021

Copy link to clipboard

Copied

In inDesign my text contains some image.png (icons in board game cards) I want every number to be bold before the image.png.

Its something like this:
"Yo can deal +2/damage.png/ if you...."

"Yo pay 9/coin.png/ if you...."
"deal 10 cards"

the 10 in the last line dont have any image so it should be normal.

My code now looks like this: 
\+|\-\d+|\d+

but this makes the 10 bold in this line:
"deal 10 cards"

TOPICS
How to

Views

77

Likes

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

Adobe Community Professional , Feb 11, 2021 Feb 11, 2021
This kind of search will find numbers anywhere in the line, not within a certain position. A similar search (using a utility from @Peter Kahrel called GREP Editor lets me see this in realtime). Instead, I'd use a Nested style that applies no style until it sees a number, then applies a bold until it sees a letter.  You can still use your GREP style to look for plusses and minuses.

Likes

Translate

Translate
Adobe Community Professional ,
Feb 11, 2021 Feb 11, 2021

Copy link to clipboard

Copied

LATEST

This kind of search will find numbers anywhere in the line, not within a certain position. A similar search (using a utility from @Peter Kahrel called GREP Editor lets me see this in realtime).

Screen Shot 2021-02-11 at 21.44.43.png

Instead, I'd use a Nested style that applies no style until it sees a number, then applies a bold until it sees a letter.

 

Screen Shot 2021-02-11 at 21.50.15.png

 You can still use your GREP style to look for plusses and minuses.

Likes

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