It was brought to my attention that the regular expressions used in the article on serving up XHTML with the correct MIME type were flawed. Apparently, they were incorrectly reading and comparing the Q weighting, by only looking for numbers between 0.1 and 0.9. My hopeless knowledge of regular expressions didn't catch it first time around.
With the help of Kornel Lesinski, I was able to refine the expressions. They can now cope with any number between exactly zero and exactly one, with up to three decimal places, as described in this section of the HTTP 1.1 protocol.
I found the exercise particularly useful, because it helped me to better understand how regular expressions work. Cool.