Quote:
Originally Posted by ElMiko
ahhhhh, interesting. Never even occurred to me to break it up like that. Obviously, I'm still holding out hope for something that can be done in a single search, but failing that, your solution will work nicely. Thanks, Jellby!
@Tex2002ans - Thanks for the input! I'm not quite following all the pieces of your search, though... particularly the highlighted part below.
Code:
(“[^ ”]+\s[^”,]+)(”)
|
A single word in between quotes will have ZERO spaces, while a quotation with multiple words will have
AT LEAST ONE space.
Actually I made a slight mistake in that regex. Here is a better version:
Code:
(“[^ ”]+\s[^”]+[^,!/?/.])(”)
The red section will grab the left quotation + the first word + space. Since a single word in quotations does not include a space, the red section will prepare the regex to only match TWO or more words between quotes.
The right quotation is NEEDED in the green section. This means that after the first word, it will continue to grab everything UP TO the right double quotation.
The characters in blue are OPTIONAL, and are there to say "if the quotation ends with this character, it is valid, so skip over this."
In this case, it says if the blue character is a ',', '!', '?', or '.', the quote is valid.
The Orange section just grabs the right quotation and makes it easy to do a Search and Replace.
Code:
“My job is exhausting. My job is very exhausting! Did I mention that my job is extremely exhausting” Tom said laboriously.
If I wanted to say every quotation which ends with a 'g' is valid, I can use the regex:
Code:
(“[^ ”]+\s[^”]+[^g])(”)