Thanks Jellby! Guess I was a little vague, there.
BTW, I just tried pepak's regex. Worked pretty well, finding left and right single-quotes (apostrophes, literally -- I just replaced the rsquo's from the example), when someone is quoting something inside dialogue. (ie: "He said 'xylophone,' did he?" asked Boojum.) Let me easily switch to lsquo and rsquo.
Only had one false positive. There was a positive there too, but some short distance preceding it was an
'em and it was lumped into the positive, ie:
Quote:
I saw 'em blah blah 'positive quote.'
|
was all highlighted (except
I saw.) Pretty easy to recognize, though. It's a keeper!
But I was working in an HTML document, so I modified it slightly afterward:
Quote:
([>_;])'(.*?[^a-z_])'([_&<])
|
adding ; and &, which allows for things like: "'Xylophone,' yup, 'xylophone.'" he responded.
Worked awesomely, had only one similar false positive (that contained two positives) and beat my prior search regex:
with an ugly stick; the old one required me to make a lot more decisions, found many (hundreds) more false positives.
But I did the modified run after initially running his regex. Anyone see a reason why it might not work straight-up? I'm having trouble imagining a sentence that would false positive because of ; and &...
m a r