1 person found this helpful
m\K2 or (?<=m)2 + Grep style! ;-)
I use grep styles for that task. It's an amazing option! works also for m3 or in case of chemicals for H2O.
Create a character style:
Create a Paragraph style. I create always a basic paragraph style and derive all subsequent style from that one and change only what needs to be changed.
Create a new grep style. Grep styles are character styles attributed to a specific situation (ie all m2 strings).
Apply a character style (existing or create a new one). "To Text" is the search string function, default is "\d+" meaning "any digit, the "+" repeat.
Now comes the cryptic magic:
(?<=m)2 means look 2 and if m precedes, apply SUPPER (character style).
To get also m3 as SUPER:
The italic is a manual character style! So they can be cascaded.
more information on grep styles may be found here:
BTW: Grep styles are somehow cryptic, but basic operations can be made using the "@" character, when inputting data.
The grep shown above has one disadvantage:
The grep style looks only for the "m2" combination. There is a possibility to look for the beginning and end of a word to make it fail safe.
Dangerous way if "Font" different settings!
I’m doing this with grep styles... works when your type or copy/paste ...