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

grep question

Guru ,
Jul 12, 2021 Jul 12, 2021

Copy link to clipboard

Copied

hi,

how do i tell it in GREP to make the word max subscript after a C

example:

this is what i have:

Screen Shot 2021-07-12 at 3.22.32 PM.png

this is whatt I want:

Screen Shot 2021-07-12 at 3.22.43 PM.png

thank you 

 

TOPICS
How to

Views

541

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

correct answers 1 Correct answer

Guide , Jul 13, 2021 Jul 13, 2021

\<[CT]\Kmax\>|\<t\K1/2\>

 

(done in my car!  ðŸ˜‰ )

 

(^/)

Votes

Translate

Translate
Community Expert ,
Jul 12, 2021 Jul 12, 2021

Copy link to clipboard

Copied

This should work

(?<=C)max(?= )

It finds max when it is between a C and a space

Set the Change format to subscript.  you can also set this up as a GREP style if you define a subscript character style.

Screen Shot 2021-07-12 at 4.48.15 PM.png  Screen Shot 2021-07-12 at 4.50.36 PM.png

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
Guru ,
Jul 13, 2021 Jul 13, 2021

Copy link to clipboard

Copied

forgive me, i found an instance that breaks that rule, Cmax may sometimes be in a parenthesis:

Screen Shot 2021-07-13 at 9.31.36 AM.png

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 ,
Jul 13, 2021 Jul 13, 2021

Copy link to clipboard

Copied

\<C\kmax\>

(^/)

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
Guru ,
Jul 13, 2021 Jul 13, 2021

Copy link to clipboard

Copied

that does not work, i also need a grep for  T1/2, see below

Screen Shot 2021-07-13 at 10.00.36 AM.png

 

 

 

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 ,
Jul 13, 2021 Jul 13, 2021

Copy link to clipboard

Copied

\<[CT]\Kmax\>|\<t\K1/2\>

 

(done in my car!  ðŸ˜‰ )

 

(^/)

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
Guru ,
Jul 13, 2021 Jul 13, 2021

Copy link to clipboard

Copied

that partially works. it does not honor it in parenthesis?  

Screen Shot 2021-07-13 at 10.54.35 AM.png

Screen Shot 2021-07-13 at 10.54.42 AM.png

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 ,
Jul 13, 2021 Jul 13, 2021

Copy link to clipboard

Copied

It does!

 

(^/)

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
Guru ,
Jul 13, 2021 Jul 13, 2021

Copy link to clipboard

Copied

it does, forgive me. so many styles. you are 100% correct.

 

i tip my hat to you good man. 

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
Guru ,
Jul 13, 2021 Jul 13, 2021

Copy link to clipboard

Copied

question. intead of the 1/2, can we say any numbers? just incase i have 2/4, 1/3 or whatever other fraction they may want?

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 ,
Jul 13, 2021 Jul 13, 2021

Copy link to clipboard

Copied

Change: 1/2 in \d/\d

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 ,
Jul 13, 2021 Jul 13, 2021

Copy link to clipboard

Copied

LATEST
quote

that does not work, i also need a grep for  T1/2

 

By @JonathanArias

…and not for Tmax?

 

I had at the time many documents containing CO2, H2O, H2, O2, … Grep styles are great fun 😉

ABAMBO | Hard- and Software Engineer | Photographer

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 ,
Jul 13, 2021 Jul 13, 2021

Copy link to clipboard

Copied

Hi @JonathanArias 

\b[CTt]\K(?:[/\d]+|max)\b

 

If "c" and "C" is required, you can try

\b(?i)[ct]\K(?:[/\d]+|max)\b

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