GREP within paragraph-style: all digits except price

Engaged ,
Mar 10, 2021 Mar 10, 2021

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?

TOPICS
Scripting, Type

Views

152

Likes

translate

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 , Mar 10, 2021 Mar 10, 2021
Or simply this if you are talking about tables cells. ^[\d.]+$  

Likes

translate

Translate

Translate
Advocate ,
Mar 10, 2021 Mar 10, 2021

Copy link to clipboard

Copied

Try this:

\b(?<!,)[\d.]+(?!,)

 

Likes

translate

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
Advocate ,
Mar 10, 2021 Mar 10, 2021

Copy link to clipboard

Copied

Or simply this if you are talking about tables cells.

^[\d.]+$

 

Likes

translate

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
Engaged ,
Mar 10, 2021 Mar 10, 2021

Copy link to clipboard

Copied

Wow!

Looks so simple.

Is this meaning: "each digit and each dot whithin a paragraph whitch contains nothing else?"

Likes

translate

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
Advocate ,
Mar 10, 2021 Mar 10, 2021

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.

Likes

translate

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
Engaged ,
Mar 11, 2021 Mar 11, 2021

Copy link to clipboard

Copied

Thank you.

It was very helpful.

Likes

translate

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
Engaged ,
Mar 11, 2021 Mar 11, 2021

Copy link to clipboard

Copied

Ist it possible to reverse that to: get everything except digits and dots?

Likes

translate

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
Advocate ,
Mar 11, 2021 Mar 11, 2021

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,]+$​




Likes

translate

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