I'm reading Douglas Crockfords Javascript: The Good Parts, I just finished the regular expressions chapter. In this chapter he calls javascript's \b
, positive lookahead (?=)
and negative lookahead (?!)
"not a good part"
He explains the reason for \b being not good (it uses \w for word boundary finding, and \w fails for any language that uses unicode characters), and that looks like a very good reason to me.
Unfortunately, the reason for positive and negative lookahead being not good is left out, and I cannot come up with one. Mastering regular expressions showed me the power that comes with lookahead (and of course explains the issues it brings with it), but I can't really think of anything that would qualify it as "not a good part".
Can anyone explain why javascript (positive|negative)lookahead or (positive|negative)lookahead in general should be considered "not good"?
It seems I'm not the only one with this question (outside stackoverflow fortunately):
http://jjinux.blogspot.com/2009/03/books-javascript-good-parts-part-2.html
http://ourcraft.wordpress.com/2009/03/