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!
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
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.
Copy link to clipboard
Copied
Thanks Willi! I knew there was a way and now I know. Appreciated.