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

GREP bracket remover.

Explorer ,
Jun 18, 2025 Jun 18, 2025

Hi,

I have one more problem and i need GREP to help me.

I have document witn more that 760 pages and everywhere there is a number in brakets [1], [2], [3]

Braket Remove.png

I want to select them all and remove the brakets and the space around it.

For example from _[_1_]_ i want to stay only _1_. And this to happend with single number and double number. 

 

Can you help me

TOPICS
Print , Type
171
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

Community Expert , Jun 18, 2025 Jun 18, 2025

I replied on the other thread but someone has moved it here

 

Find

\[\s*(\d+)\s*\]

 

Change to

$1

Translate
Community Expert ,
Jun 18, 2025 Jun 18, 2025

I replied on the other thread but someone has moved it here

 

Find

\[\s*(\d+)\s*\]

 

Change to

$1

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
Explorer ,
Jun 18, 2025 Jun 18, 2025

What does  "$1" mean in GREP language?

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
Community Expert ,
Jun 18, 2025 Jun 18, 2025

It's a 'Found' reference

so in the Find part  (\d+)

\d+ is any amount of digits and encased in brackets as (\d+) marks it as 'Found'

 

$1 is the first found instance so it inserts this 

 

For example you could have 

12.94 and for some reason want to reverse this to 94.12

 

You would find 2 of them encased in brackets referenced as $1 $2 

(\d+)\.(\d+)

and change to

$2.$1

 

Now the figures reverse position because it's marked in the expression as (...) 

 

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
Explorer ,
Jun 18, 2025 Jun 18, 2025

Thank you

 

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
Explorer ,
Jun 18, 2025 Jun 18, 2025

I have one more very complex search and change.

Can i ask you here or i have to set a new post?

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
Community Expert ,
Jun 18, 2025 Jun 18, 2025
LATEST

Ask away 

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