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:
this is whatt I want:
thank you 
\<[CT]\Kmax\>|\<t\K1/2\>
(done in my car! 😉 )
(^/)
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.
Copy link to clipboard
Copied
forgive me, i found an instance that breaks that rule, Cmax may sometimes be in a parenthesis:
Copy link to clipboard
Copied
\<C\kmax\>
(^/)
Copy link to clipboard
Copied
that does not work, i also need a grep for T1/2, see below
 
Copy link to clipboard
Copied
\<[CT]\Kmax\>|\<t\K1/2\>
(done in my car! 😉 )
(^/)
Copy link to clipboard
Copied
that partially works. it does not honor it in parenthesis?  
Copy link to clipboard
Copied
It does!
(^/)
Copy link to clipboard
Copied
it does, forgive me. so many styles. you are 100% correct.
i tip my hat to you good man.
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?
Copy link to clipboard
Copied
Change: 1/2 in \d/\d
Copy link to clipboard
Copied
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 😉
Copy link to clipboard
Copied
\b[CTt]\K(?:[/\d]+|max)\b
If "c" and "C" is required, you can try
\b(?i)[ct]\K(?:[/\d]+|max)\b