Thread: Regex examples
View Single Post
Old 02-01-2015, 12:41 AM   #467
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)
Yep, with a negative lookaround (see HERE for the first explanation I saw, way back, of this trick):

Code:
((?!string).)*
Matches the dot-match-all, if NOT followed by a "string", and then repeats the search ad nauseam.


regex is not meant to do this sort of stuff, but it can be shoehorned into it.

There will be a performance hit, but how often does that become a practical matter?

Last edited by eschwartz; 02-02-2015 at 03:02 PM. Reason: if followed != if not followed. :o
eschwartz is offline   Reply With Quote