Reply To: Search/Replace Variable Prices

Home Page / Forums / General InDesign Topics (CLOSED) / Search/Replace Variable Prices / Reply To: Search/Replace Variable Prices

#64616
Justin Sligh
Member

Christophe,

Assuming a few things:
1. Currencies are whole numbers.
2. There are no spaces after the “?” in your international version (In your example, US?$65 CA?$80 have no space but EU €70 does. Was this intentional or did the forum adjust your post automatically.)

Grep Find:
(US\?|CA\?|EU )(\$|€)(\d+)

Change to:
$3$2 $1

We are asking InDesign to:
1. Find “US?”, “CA?”, or “EU ” and set as variable “$1”; find a “$” or “€” and set as variable “$2”; and find one or more consecutive digits and set as variable “$3”
2. Paste variable “$3” followed by “$2″ followed by a space and then” $1″

() Items within parentheses are sub-expressions and can be used as variables within the Change to. If you find (Red)(Blue)(Green) $1 is “Red” $2 is “Blue” and $3 is “Green”.

? and $ are functions used by grep so to look for actual characters, you need to escape them using a backslash “\”

\d indicates a digit
+ indicates one or more of the previous.

This article was last modified on July 31, 2013

Comments (0)

Loading comments...