• Global community
• Language:
• Deutsch
• English
• Español
• Français
• Português
• 日本語コミュニティ
Dedicated community for Japanese speakers
• 한국 커뮤니티
Dedicated community for Korean speakers
Exit
• GREP to find number in table following asterisks a...

# GREP to find number in table following asterisks and make bold

New Here ,
Apr 12, 2023 Apr 12, 2023

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

254

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
3 Replies 3
New Here ,
Apr 14, 2023 Apr 14, 2023

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

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

Copied

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

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

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
New Here ,
Apr 19, 2023 Apr 19, 2023

Copied

LATEST

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

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Resources
Learn and Support
Resources
Crash and Slow Performance