It's interesting to me that JWZ likes Java the language and dislikes the JVM. Of course, most of his anti-JVM posts are at least ten years old, and the JVM was quite a bit worse then, but it seems odd to me that the Java language would look good to someone with a background in Lisp and C.<p>The sentiment I see from most hackers I know these days is exactly the opposite: the Java language is not well-liked, but the JVM is.
another regular expression quote (from <a href="http://code.google.com/p/re2/wiki/Syntax" rel="nofollow">http://code.google.com/p/re2/wiki/Syntax</a>):<p>I define UNIX as “30 definitions of regular expressions living under one roof.” —Don Knuth
But he doesn't track down the source of the quote, only of a famous usage of it by JWZ. If you read to the end of the post, it's clear that no one knows who originated it, but it was in .sig files already in 1988.<p>Edit: simple googling reveals that David Tilbrook took credit for a variant of the line in 1989 (<a href="http://grosskurth.ca/bib/1989/tilbrook.pdf" rel="nofollow">http://grosskurth.ca/bib/1989/tilbrook.pdf</a>, search for "awk"). Since that's long before anyone would have had reason to misappropriate it, I'd say that's pretty convincing.<p>Friedl, as the author of a (the) book on regexes, is only interested in the regex version of the quote. But that one is obviously just a derivative.<p>Edit 2: I attempted to email Tilbrook to see if he wants to comment on the joke. If I get a reply I'll post it here. Silly, perhaps, but this kind of folklore is fun.<p>Edit 3: The email bounced. Is there an HNer with a premium LinkedIn account who wants to message him for us? I found his profile but it won't let me do that without paying (no way in hell). If so, email me (address in profile) and I'll send over what I wrote.
Shameless self plug: I created nyhtp.com based off of this quote after talking to a fellow dev as a quick learning experience with Sinatra/Mongo. The history was interesting, though.
Here is a regular expression for C++-style comments<p><pre><code> (/\*([^*]|[\r\n]|(\*+([^*/]|[\r\n])))*\*+/)|(//.*)
</code></pre>
(source: <a href="http://ostermiller.org/findcomment.html" rel="nofollow">http://ostermiller.org/findcomment.html</a> )<p>I recently wrote a lexicasl analyser for a language that uses C++-style comments. My first attempt used regular expressions, but I later scrapped them for something I could understand. Here is the relevant bit:<p><pre><code> # //... comments
if ss.isNextSkip("//"):
ss.skipPast("\n")
return
# /*...*/ comments
if ss.isNextSkip("/*"):
ss.skipPast("*/")
return
</code></pre>
I will leave it to the reader to decide which is clearer.