Reply To: Adding spaces to large figures ? with GREP?

Home Page / Forums / General InDesign Topics (CLOSED) / Adding spaces to large figures ? with GREP? / Reply To: Adding spaces to large figures ? with GREP?

#34491
Masood Ahmad
Participant

Hi Justin,

I am also trying my hands on the GREP and while checking your code at my end, I found that “(?<=\d)\d\d\d(?!\d)” expression will only find the last three digits from a list of numbers. For example in a number 123456789, the expression will only select 789, i.e. the last three digits and it will then move on for the next search.

However, if you use your GREP expression shown above “\d(?=(\d\d\d)+\D)” in the Find What panel and replace it with the character style, you just suggested above, then the search will find all the groups of 3 digits starting from the ending position. For example in a number 123456789, it will become 123 456 789.

Hans, in addition to Justin, I would like to add a GREP expression, in case you need to create a 3 digit group from the beginning of the numbers, For example: 1234567, it will become 123 456 7.

Grep Find:
(\d\d\d)(?=\d)

Grep Replace:
$0 (please note that there is a space after $0)

Thanks

This article was last modified on July 30, 2013

Comments (0)

Loading comments...