Copy link to clipboard
Copied
Hello,
I hope someone can help me with the following.
I am looking for a GREP Code in which it is possible to achieve this:
“no. 123” to “no 123” and “nos. 123” to “nos 123”
Just to clarify, in the letters “no” and “nos”, only the “o” and “os” may be converted to (open-type) superscript. And the dot has to be deleted and and the subsequent numbers should be retained.
Thank you very much.
Kind regards,
Dylan
Copy link to clipboard
Copied
Find what:
(n)(o|os)\.
Change to:
N$2
This would result in no and nos as No and Nos and would delete the dot at the end
Next:
Find what:
(?<=N)((o)|(os))(?= \s)
Change to:
$2
Change Format:
Superscript
Copy link to clipboard
Copied
Hello,
Thank you for your reply. But in this case it changes the letter 'n' also to superscript, while it should remain undercast.
How can this code be adjusted?
Thank you very much.
All best,
Dylan
Copy link to clipboard
Copied
\bn\K(os?)\.(?=\h\d)
(^/) The Jedi
Copy link to clipboard
Copied
It worked correctly for me.