In GREP you need to escape the $ symbol. Use: \$
bonus point question: I have a price of $9.99....I want to superscript the $ (done), but I also want to delete the punctuation mark & superscript the final 2 digits, these digits will change so I can't just search for .99
the winning answer gets an all expenses trip to the rugby world cup final*
*This prize will not be honoured
\.\d\d this superscripts the .99
so now i just need to know how to remove the .
1 person found this helpful
In the following I assume you are driving your PRICE paragraph style through GREP styles. (Tell me if I'm wrong.)
> I also want to delete the punctuation mark
GREP styles don't allow you to actually delete characters. The usual workaround is to apply a special Transparent character style based on a [None] character color and a tiny Horizontal Scale. (5% should be fine to clear a simple dot.)
Another issue is that the GREP lookahead feature has some problems with quantifiers, so we have to be smart.
Here are the character styles you need for that exercice:
1. Superscript (you already have it, I suppose. It's based on Position:Superscript)
2. Transparent (see above)
3. NormalScript (which simply reverts what SuperScript does: Position:Normal).
Now open the GREP style panel of your PRICE paragraph style and create the following rules, in that order:
— Apply Superscript to the pattern: \$[\.\d]+
— Apply Transparent to the pattern: (?<=\d)\.
— Apply NormalScript to the pattern: (?<=\$)\d+
(BTW, this thread has nothing to do with InDesign scripting.)