Did I say comprehensive? I meant obscene. I mean, I’m embarrassed that that’s even in my codebase. It’s much better to do feature detection, instead.

So get rid of that regex. Besides, you know what they say.

Some people, when confronted with a problem, think “I know, I’ll use regular expressions.” Now they have two problems.

Oh, regular expressions have their place, to be sure, but this is not one of them. User agent sniffing is going about the problem all wrong. You can spoof the user agent, but you can’t spoof your browser’s feature support. And what about future browsers? Fuggedaboutit!