Skip to main content
d_mancini
Inspiring
January 19, 2024
Answered

GREP for select the third occurrence

  • January 19, 2024
  • 1 reply
  • 256 views

Hi,

I have an INDD document with hundreds of products ,each of which has 5 prices that I manage with conditional text. For each string of prices I should locate the third price with a GREP to be able to assign, with a global find/replace, a different condition.

 

For example, in the following strings I should select € 11,31 / € 1,60 / € 14,21 and so on 

 

€ 7,80€ 10,14€ 11,31€ 12,09€ 13,26

€ 1,10€ 1,43€ 1,60€ 1,71€ 1,87

€ 9,80€ 12,74€ 14,21€ 15,19€ 16,66

 

Thanks in advance for anyone who can help me.

This topic has been closed for replies.
Correct answer d_mancini

It’s perfect... thanks!

1 reply

Braniac
January 19, 2024

This expression matches the third price in each line:

(€\h[\d,]+){2}\K€\h[\d,]+
d_mancini
d_manciniAuthorCorrect answer
Inspiring
January 19, 2024

It’s perfect... thanks!