I thought this would be a common and easy thing to do, but so far I've been unable to find an answer by Googling.
How would I regex match a substring only if it is not immediately preceded by a specific string?
In this case I want to match " (a space followed by a quotation mark) but only if it's not preceded by , (a comma). I've tried a few different things. Currently (?!,) " is as close as I've gotten, but the negative lookahead doesn't seem to be working as I expect.
Some examples of what I want:
Laura said "What have you done?" - 1 match
Laura said, "What have you done?" - 0 matches (there's a comma)
"Come with me," David said. - 0 matches (no space before the ")
Michael said "Throw it!" Jessica replied, "I'd rather not..." Shia shouted "Just do it!"
- 2 matches
This is in Notepad++. What am I doing wrong?
a,<2 or 3 spaces>", should anything be matched here?