GREP Newbie find & delete text

Explorer ,
Mar 09, 2022 Mar 09, 2022

Copy link to clipboard

Copied

I am working on 14 documents that each paragraph has a number and a space or an inline icon, number and space. I need to remove the number & space. I am then changing each paragraph to a numbered list.

 

I am using  ^\d+?\s+ which works fine for the paragraphs with ni icon.

 

 ^~a\d+?\s+ works for selecting the icon number & space, but I want just the number & space after the icon. Also ther can be anywhere from 1 to 4 icons.

 

Any ideas how this can be done? Look ahead of the icon doesn't seem to work.

 

Screenshot 2022-03-09 092101.png

 

Thanks

TOPICS
How to , Scripting

Views

76

Likes

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 09, 2022 Mar 09, 2022
You can use this for both scenario: (?<!.)~a*\K\d+?\h+  

Likes

Translate

Translate
Advocate ,
Mar 09, 2022 Mar 09, 2022

Copy link to clipboard

Copied

You can use this for both scenario:

 

(?<!.)~a*\K\d+?\h+

 

 

Likes

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
Explorer ,
Mar 09, 2022 Mar 09, 2022

Copy link to clipboard

Copied

LATEST

Thanks, that works great .

Just so I learn & understand, I know some of those and just discovered the K. 

 

Likes

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