6 Replies Latest reply on Mar 13, 2013 7:26 PM by Hawkeye93611

# Grep - Superscription the the first \$ sign or the ¢ sign and the last 2 digits

Hello.

Someone before me created an expression in InDesign CS4 that will superscript the \$ sign, the ¢ sign and the last 2 digits but when I converted to CS6 it stopped working. I work on grocery ads and I use this a lot when adding prices to an item, and the grep expression saves me a great deal of time. Anyone out there having the same issues, and or can lend me a helping hand on creating a new one in CS6.

• ###### 1. Re: Grep - Superscription the the first \$ sign or the ¢ sign and the last 2 digits

What's the GREP expression that stopped working?

• ###### 2. Re: Grep - Superscription the the first \$ sign or the ¢ sign and the last 2 digits

Hi John. Thanks for showing interest. This is what is showing up in the Grep Style. I have no clue whatsover. I have never even done any of these before.

\d{1,2}/|/|\\$|\¢|(?<=/|\\$|\d{3,})\d{2}\$(?=\$)

• ###### 3. Re: Grep - Superscription the the first \$ sign or the ¢ sign and the last 2 digits

Well, everything inbetween vertical bars | is an OR condition.

So it is \d{1,2}/ OR \\$ OR etc.

Unsurprisingly, the most complex of them, (?<=/|\\$|\d{3,})\d{2}\$(?=\$) is the one that fails.

It appears that the problem is the first part of it, the zero-width lookbehind assertion.

So you could get something that sort-of works by omitting that condition and just using \d{1,2}/|/|\\$|\¢

That doesn't get you the more complicated expression, which basically was:

"If you have two digits at the end of a line, followed by the end of a line (yes this is redundant!), and preceded by EITHER a slash, a dollar-sign, or 3-or-more digits."

Maybe someone who uses GREP styles more knows what broke in CS6? I haven't had a chance to test your pattern in both CS6 and CS5...

• ###### 4. Re: Grep - Superscription the the first \$ sign or the ¢ sign and the last 2 digits

Thanks again John. This partially solved the problem. The \$ sign and the ¢ sign now works but the last 2 digits still need to be superscript.

• ###### 5. Re: Grep - Superscription the the first \$ sign or the ¢ sign and the last 2 digits

If you have just price in your paragraph, this will work correctly:

\\$|¢|\d{2}(?!¢)\>

Hope that helps.

--

Marijan (tomaxxi)

http://tomaxxi.com

• ###### 6. Re: Grep - Superscription the the first \$ sign or the ¢ sign and the last 2 digits

Wow!!!!! It works!!! Thanks so much Marijan, greatly appreciated. You guys are awesome.