I have a very long document with messed up spacing between the open and closed quotes.
There is no consistency in the errors.
Examples:
"This sentence is supposed to be enclosed in quotes. "See the quote at the start of this sentence should be closing the sentence before it.
This sentence should not be enclosed in quotes." This sentence should be."
Can you see the errors? I can't just do a straight find and replace it would just flip the errors, fixing some and creating others.
Thanks for any help you can give me.
fixing sets of quotes
Re: fixing sets of quotes
You would have to search using a regex containing (only) two quote characters.
You could allow or require the first quote character to be followed by a space character.
You could allow or require the second quote character to be preceded by a space character.
Try something like this.
Find:
"( *)([^"]+)( *)"
Replace by:
$1"$2"$3
Because the space characters at both the start and the end of the quoted text are optional, this will also match quoted texts without any of them. It won't do any bad replacing them "by themselves" (as there are no space characters re-placed or added), but this may take some extra time.
However, you probably will want to be sure that you really don't change unintended matches.
You may use a text editor's find and replace feature to manually change found matches.
You could allow or require the first quote character to be followed by a space character.
You could allow or require the second quote character to be preceded by a space character.
Try something like this.
Find:
"( *)([^"]+)( *)"
Replace by:
$1"$2"$3
Because the space characters at both the start and the end of the quoted text are optional, this will also match quoted texts without any of them. It won't do any bad replacing them "by themselves" (as there are no space characters re-placed or added), but this may take some extra time.
However, you probably will want to be sure that you really don't change unintended matches.
You may use a text editor's find and replace feature to manually change found matches.