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

Grep: find text between quotations when the number of words are more than 20?

Participant ,
Mar 08, 2017 Mar 08, 2017

Copy link to clipboard

Copied

(?<=“).*?(?=“)

is a grep expression to find text inside quotation marks.

but how to delimit the search to define exactly a number of words inside the curly quotes?

for example, detect only quotations that have more than n words? 50, for example?

this comes as it is a publishing practice to style those «block quotations»  and get broken off without quotation marks.

thanks

Views

9.8K

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 09, 2017 Mar 09, 2017

Did you try Laubender 12 ?

If you copy/paste the expressions you have to look carefully after the curley quotes in the expression.

Best you type the expression yourself. Without using straight quotes.

I only tested with English text. Not e.g. German text where the quotes for opening and closing are very different.

The only GREP expression working straight for me is:
Laubender 12

“([()[\]]?\<[^“]+\>[,;:!?.…()[\]\h]*){21}”

Obi-wan 15 is also working, but first I had to change the quotes to that:

“(([^ “]

...

Votes

Translate

Translate
Enthusiast ,
Mar 08, 2017 Mar 08, 2017

Copy link to clipboard

Copied

The issue here is that you'll have to account for any types of spaces and punctuations that may occur, while limiting the number of WORDS to 50. In theory, it's probably doable...it's just above my "pay grade," as they say.

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