Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • EspaƱol
      • FranƧais
      • PortuguĆŖs
  • ę—„ęœ¬čŖžć‚³ćƒŸćƒ„ćƒ‹ćƒ†ć‚£
  • ķ•œźµ­ ģ»¤ė®¤ė‹ˆķ‹°
0

Grep to find a range of numbers

Contributor ,
Sep 27, 2017 Sep 27, 2017

Hi,

Can anyone help with a grep query that finds specific ranges of numbers?

I'm trying to find/replace specific ranges so that any number found within that range has its paragraph style changed.

There are four ranges and I've worked out the last two, but am struggling with the first two without affecting higher numbers.

1-45 = ?

46-90 = ?

91-135 =

9[1-9]|1[0-2]\d|13[0-5]

136-180 =

13[6-9]|1[4-9]\d

Anyone know how?

3.5K
Translate
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

LEGEND , Sep 27, 2017 Sep 27, 2017

\b([1-9]|[1-3][0-9]|4[0-5])\b

\b(4[6-9]|[5-8][0-9]|90)\b

\b(9[1-9]|1[0-2][0-9]|13[0-5])\b

\b(13[6-9]|1[4-7][0-9]|180)\b

(^/)

Translate
Adobe Employee ,
Sep 27, 2017 Sep 27, 2017

Hi,

Both of the needed greps look fairly easy to construct.

I would recommend you read this article https://indesignsecrets.com/topic/using-grep-to-select-a-number-range  and still if you face any difficulty do let us know.

-Aman

Translate
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
Contributor ,
Sep 27, 2017 Sep 27, 2017

Hi, I've wlready been through that one. I can get round the problem by doing find/change grep queries one after the other. So if the first changes every number, the next will change from where I need it to, then the next and so on.

Thought there would be something more specific to pin down exact ranges.

Translate
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
LEGEND ,
Sep 27, 2017 Sep 27, 2017

\b([1-9]|[1-3][0-9]|4[0-5])\b

\b(4[6-9]|[5-8][0-9]|90)\b

\b(9[1-9]|1[0-2][0-9]|13[0-5])\b

\b(13[6-9]|1[4-7][0-9]|180)\b

(^/)

Translate
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
Contributor ,
Sep 28, 2017 Sep 28, 2017
LATEST

PERFECT! Many, many thanks.

Translate
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