Skip to main content
Participant
February 2, 2023
Answered

Find Paragraphs with Specific Number of Words

  • February 2, 2023
  • 1 reply
  • 246 views

Is there a way I can search for paragraphs with a specific number of words? I imported a text file and I figured a quick way to find all the headings would be to find all the paragraphs with 1, 2, 3, 4 words. Is this possible? This would save me a lot of time if it is, otherwise, I'm looking for them manually...

This topic has been closed for replies.
Correct answer FRIdNGE

Basic Grep:

 

1 word: ^(\w+\h){0}\w+$

2 words: ^(\w+\h){1}\w+$

3 words: ^(\w+\h){2}\w+$

4 words: ^(\w+\h){3}\w+$

 

(^/)  The Jedi

1 reply

FRIdNGE
FRIdNGECorrect answer
February 2, 2023

Basic Grep:

 

1 word: ^(\w+\h){0}\w+$

2 words: ^(\w+\h){1}\w+$

3 words: ^(\w+\h){2}\w+$

4 words: ^(\w+\h){3}\w+$

 

(^/)  The Jedi

Participant
February 2, 2023

Thank you, thank you, thank you so much. Definitely, saving things.