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

GREP Code applying superscript only to 1 or 2 letters

New Here ,
Aug 01, 2023 Aug 01, 2023

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

TOPICS
Feature request , How to

Views

183

Translate

Translate

Report

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

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

Mike Witherell

Votes

Translate

Translate

Report

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

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

Votes

Translate

Translate

Report

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

Copy link to clipboard

Copied

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

 

(^/)  The Jedi

Votes

Translate

Translate

Report

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

Copy link to clipboard

Copied

LATEST

It worked correctly for me.

Mike Witherell

Votes

Translate

Translate

Report

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