Thread: Regex examples
View Single Post
Old 11-18-2014, 02:39 PM   #436
eschwartz
Ex-Helpdesk Junkie
eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.
 
eschwartz's Avatar
 
Posts: 19,421
Karma: 85400180
Join Date: Nov 2012
Location: The Beaten Path, USA, Roundworld, This Side of Infinity
Device: Kindle Touch fw5.3.7 (Wifi only)
Quote:
Originally Posted by signum View Post
Yeah, it works, sorta. But it matches all paragraphs with quotation marks, whether or not they are "valid", i.e. matched or balanced. This was first reported by the OP in msg #428, above.
Well, my regex was not meant to find paragraphs where the only quotation marks were at the end. In fact, I specifically precluded the idea. You need a second regex for that.

But they should correctly have found #1 and #3, and I cannot see why they would find, for example,
Code:
<p>"Hello."</p>
So how exactly was my regex matching valid paragraphs, I wonder? This bit should make it impossible (unless there was random extra space at the end or some such?):

Code:
[^"”]</p>
eschwartz is offline   Reply With Quote