I'd love some input on what I think is a very basic GREP style application.
I'm working on a template that will have a good deal measurements including squared or cubed measurements (i.e., cm2, m3, and km2).
So I thought that it would be simple to create a “SuperScript” character style, then apply a GREP style to the paragraph style that had a positive look behind for: digit, space, either cm, m, or km followed by a digit that would have the SuperScript character style attached. I was wrong! I can get parts of it to apply, but it's not applying in all instances and sometimes as I was trouble shooting using a string of distances separated by commas it would end up applying to a single digit of the number being squared rather than on the distance itself (e.g., 35 km2) [ sigh… ]
The sample text I've been using to try and work this out with is: 15 m3, 25 cm2, 35 km2
The most current itteration of my GREP query is:
(?<=(backslash)d (cm|m|km))(backslash)d
Note: backslash before “d” kept disappearing when I posted so I've simply put it above in brackets.
This works as expected but will not apply the superscript to the meter measurment resulting in the following: 15 m3, 25 cm2, 35 km2
Any input would be appreciated.
Troy