Copy link to clipboard
Copied
Hi,
I'd like to create a GREP style to change the number 2 to a superscript after the letter m
50 m2, balkon 24 m2
Thanks
Mark
Copy link to clipboard
Copied
\bm\K2|3
Also covers m3
\bc?m\K2|3 will pick up centimeters, too.
Copy link to clipboard
Copied
Thank you for your prompt reply.
I've tried the GREP style as suggested however it changes all the 2's and not just the 2 after m.
Ultra Geniş Dış Kabin
23 m2
Copy link to clipboard
Copied
… or try this safer approach with parenthesis:
\bc?m\K(2|3)
or, if you don't care about cubic and centimeters, just the basic:
\bm\K2
Copy link to clipboard
Copied
it must work.
What ID version you're using? Could you show Grep Style tab of your para style?
Like this:
Copy link to clipboard
Copied
Hi Winterm (long time no see!)
Your grep says :
"catch 2 if followed by (c)m"
or
"catch 3"
Make a character class [23] instead:
\bc?m\K[23]
To go further, you could add a word boundary at the end in order to secure a little bit more. Unlikely to get such cases (I had hard time finding an example...), but well, it's just a metacharacter to add:
And maybe think about square kilometers, or millimeters, why not ^^
\b[mck]?m\K[23]\b
Copy link to clipboard
Copied
hi vinny
thank you, sure you're right.
it's been a damn busy days, obviously, too busy… I should take a break.
Copy link to clipboard
Copied
I must say I missed your correction too... [busy day too...]
Should work fine too.
Although I have the feeling that custom class characters are more efficient. But I'm quite unsure about that....
Copy link to clipboard
Copied
Hello, I know some time passed but I have a question.
How to modify this GREP to make superscript different set of characters?
I have "loremipsum1)" and want part "1)" to be in superscript.
I was trying with "\b[mck]?m\K[1)]\b but no luck, I'm completly green to GREP.
Copy link to clipboard
Copied
try
\b[ckm]?m\K1\)
For some reasons putting a word boundary after the closing parenthesis does not work.
Copy link to clipboard
Copied
Hi Mark,
in case you are on InDesign CC 2019 version 14.0.2 make sure that the following bug fix is installed:
GREP search fails to find all the matching instances in long InDesign documents
This fix will not delivered through the Adobe Creative Cloud Desktop App.
Regards,
Uwe