I'm trying to find long quotes in the text that I'm editing so that I can apply a different style to them. I've tried this GREP:
~[.{230}(?!.~])
What I need is for the GREP to find any 230 characters preceded by a left/opening quote mark, not including any 230-character sequence including a character followed by a right/clsoing quote mark. This should then eliminate quotes of less than 230 characters from the search. My GREP finds the correct length sequence but doesn't exclude those sequences which include a right quote mark.
So I want to find this, which my GREP does:
But not this, which my GREP also finds:
Because it has a closing quote in it and is therefore what I'm classing as a short quote.
Any ideas? TIA
You can match an opening
‘
followed by 230 or more occurrences of any character except an opening or closing quotation mark.To not match the closing quotation mark, you can assert it using a positive lookahead.
‘
Match‘
[^‘’]{230,}
Repeat 230+ times any char except‘
or’
using a negated character class(?=’)
Positive lookahead, assert’
directly to the rightSee a regex demo.