I am trying to put together a GREP that will look through and find 7. thats the number seven followed by a point and then apply a style to the point and not the seven.
Ex. if there is 17.99 the style would apply to the decimal in that case but not in this 14.99. I have managed to pull togetther some nice things with GREP but this one is illuding me for some reason. I have tried some many combonations i am probbibly missing something simple.
Can some one help me out?
Possitive lookbehind is what you need:
app.findGrepPreferences.findWhat = "(?<=7)\\.";
it means ==> find every "dot" which follows "7".
so your code could be:
app.findGrepPreferences = app.changeGrepPreferences = null; app.findGrepPreferences.findWhat = "(?<=7)\\."; app.changeGrepPreferences.appliedCharacterStyle = "yourDotStyle"; app.activeDocument.changeGrep(); app.findGrepPreferences = app.changeGrepPreferences = null;
actualy.. you should also use a lookahead, so you won't find stuff like: "See page 7."
so the grep expression is: (?<=7)\.(?=\d)
and for scripting, using peter's trick i learned a few days ago: