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

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

400

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

Community Expert , Mar 10, 2021 Mar 10, 2021

Or simply this if you are talking about tables cells.

^[\d.]+$

 

Votes

Translate

Translate
Community Expert ,
Mar 10, 2021 Mar 10, 2021

Copy link to clipboard

Copied

Try this:

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

 

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

Copy link to clipboard

Copied

Or simply this if you are talking about tables cells.

^[\d.]+$

 

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
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?"

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 ,
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.

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

Copy link to clipboard

Copied

Thank you.

It was very helpful.

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
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?

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

Copy link to clipboard

Copied

LATEST

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




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