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

GREP to find number in table following asterisks and make bold

New Here ,
Apr 12, 2023 Apr 12, 2023

Copy link to clipboard

Copied

I'm trying to understand GREP and need to find all numbers that follow an astricks "*" within all tables in my document.  There may be numbers that have a space between the astricks  like "* 199" or the astricks may be right next to the number "*199".  The number can be any number of digits and some with decimals.  Thanks!

TOPICS
How to

Views

301

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 ,
Apr 14, 2023 Apr 14, 2023

Copy link to clipboard

Copied

I think I solved this on my own.  It's very basic GREP but you have to start somewhere!  So if it helps anyone else here is what I came up with ...

For the instances that it is a number after an asterisks with no space between the asterisks and number I used this...

(?<=\*)\d*

 

I added a second GREP for the instances that have a space between the astericks ...

(?<=\*\s)\d*

 

I'm sure there is a way to do this with one GREP but I have not gotten that far yet!  

 

Since the aterisks is also part of the GREP language you must add a "\" before it so it does not think you are writing more grep code.  If you symbol is something other than an asterisk, you would just replace the \* with whatever it is, for example of your number was preceded with a dollar sign you would use \$.

 

Hope this helps another newbie!

 

Cheers

 

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 ,
Apr 14, 2023 Apr 14, 2023

Copy link to clipboard

Copied

Make a single GREP (?<=\*\s?)\d*

You can make a GREP style. Or you can find and replace, but style is better here.

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 ,
Apr 19, 2023 Apr 19, 2023

Copy link to clipboard

Copied

LATEST

Thanks Willi!  I knew there was a way and now I know.  Appreciated.

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