Copy link to clipboard
Copied
Hi.
I want to use only one paragraph-style for a table. In this table there are text and different kind of digits (price, amount, measure, etc.). with the included GREP I only want to grab the simple digits for the number of piecies (top row).
The table could look like:
quantity | 1 | 10 | 100 | 1.000
price | 1,00 | 2,00 | 3,00 | 4,00
^(?=\d*\d)((?!,)\d)*$
That´s how I´ve tried. But It doesn't format the digits behind commas and dots.
Any idea?
Or simply this if you are talking about tables cells.
^[\d.]+$
Copy link to clipboard
Copied
Try this:
\b(?<!,)[\d.]+(?!,)
Copy link to clipboard
Copied
Or simply this if you are talking about tables cells.
^[\d.]+$
Copy link to clipboard
Copied
Wow!
Looks so simple.
Is this meaning: "each digit and each dot whithin a paragraph whitch contains nothing else?"
Copy link to clipboard
Copied
[ ] are charaters set. So we are looking at ONLY digits and dot one or more time between begining and end of paragraph.
Copy link to clipboard
Copied
Thank you.
It was very helpful.
Copy link to clipboard
Copied
Ist it possible to reverse that to: get everything except digits and dots?
Copy link to clipboard
Copied
If you use this
^[\d.]+$
to format the digits and dot, than the everything else is apply by the paragraph style.
Unless you want only digits and comma, then:
^[\d,]+$