adobe-indesigngrep-indesign

Using GREP to format numbers which are succeeded by specific characters


Hi dear stackoverflow community,

I have a small GREP question and would need your help. In my catalog, there are some ordering numbers which need specific formatting.

As you can see, the numbers are always bold and they also are colored when they are preceded by a "to ". However, I want the two numbers before the " to" to be colored also. I was not able to find out how this is done. This is how they SHOULD look like using GREP. Basically the "00" is also colored.

How it should be

Right now, my GREP code looks like this.

(?<=\d\d)-\d\d(?=\sto)

On the right you can see that right now, the "00" in front of the "to" is not colored.

Does someone know why this is not working? :)

This is how my GREP window looks like at the moment


Solution

  • Apply the following three Grep patterns to the Paragraph Style:

    Note: The two different Character Styles used, namely Bold, and Bold-Color


    Paragraph Style Options > GREP Style:

    enter image description here

    Result:

    enter image description here