View Single Post
Old 05-17-2009, 08:15 AM   #27
rogue_ronin
Banned
rogue_ronin has learned how to read e-booksrogue_ronin has learned how to read e-booksrogue_ronin has learned how to read e-booksrogue_ronin has learned how to read e-booksrogue_ronin has learned how to read e-booksrogue_ronin has learned how to read e-booksrogue_ronin has learned how to read e-books
 
Posts: 475
Karma: 796
Join Date: Sep 2008
Location: Honolulu
Device: Nokia 770 (fbreader)
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: &quot;'Xylophone,' yup, 'xylophone.'&quot; he responded.

Worked awesomely, had only one similar false positive (that contained two positives) and beat my prior search regex:
Quote:
'(.*?)'
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

Last edited by rogue_ronin; 05-17-2009 at 08:18 AM.
rogue_ronin is offline   Reply With Quote