GREP Style Help - Subscripting Chemical Formulas

New Here ,
Jan 18, 2021 Jan 18, 2021

Copy link to clipboard

Copied

Hello there! 

I'd like to create a GREP script for a project I'm working on. This particular document is going to be talking about CO2, N2, and CH4. I would like those numbers to be subscripted. Here's the kicker though...the company I work for, CO2Meter, is also mentioned in this document. I DON'T want that 2 to be subscripted. Below is a script I've found that is working for the subscripting. I just need to add in how to NOT have the '2' in CO2Meter get subscripted. Any suggestions would be incredibly helpful!

 

((?<=Na|Cl)|(?<=H|C|O|S|N))\d{1,3}(?!\d)

TOPICS
How to, Scripting

Views

112

Likes

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

Advocate , Jan 18, 2021 Jan 18, 2021
Change (?!\d) at the end for (?!\d|Meter)

Likes

Translate

Translate
Advocate ,
Jan 18, 2021 Jan 18, 2021

Copy link to clipboard

Copied

Change (?!\d) at the end for (?!\d|Meter)

Likes

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 ,
Jan 18, 2021 Jan 18, 2021

Copy link to clipboard

Copied

LATEST

You, my friend, are a lifesaver! Thank you so much.

Likes

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