Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

GREP Code applying superscript only to 1 or 2 letters

New Here ,
Aug 01, 2023 Aug 01, 2023

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

TOPICS
Feature request , How to
418
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Aug 01, 2023 Aug 01, 2023

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

Mike Witherell
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Aug 01, 2023 Aug 01, 2023

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

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guide ,
Aug 01, 2023 Aug 01, 2023

\bn\K(os?)\.(?=\h\d)

 

(^/)  The Jedi

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Aug 01, 2023 Aug 01, 2023
LATEST

It worked correctly for me.

Mike Witherell
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines