/(bb|[^b]{2})/
Sunday, December 2nd, 2007 • Related • Filed Under
…That is the question. ThinkGeek is selling that on a t-shirt for the "regular expression junkie + lover of literature." Wearing that around would be a sure way to get me to notice you, especially if you have a nice rack or happen to be an Angelina Jolie lookalike.
Note that the parentheses are unnecessary except in the case of Perl-folk wishing to avoid using the naughty $& variable for performance reasons. Also, the expression is buggy in that many alternatives to "bb" are not matched, so it would probably be better written as simply /bb|.*/s. For a JavaScript solution you could try var answer = /^bb$/.test(i);.
Alright, I'm done debugging the shirt now.

![/(bb|[^b]{2})/](http://blog.stevenlevithan.com/assets/images/2b-or-not-2b.jpg)
Comment by Azat Razetdinov on 3 December 2007:
/bb|(?!bb).*/
Comment by William "The Ownage" Bowen on 4 December 2007:
I find it funny that while you were debugging shirts I was busy debugging the pants off girls.
And I don’t even know what that means.
Comment by Steve on 4 December 2007:
Yeah, well, I was worn out from debugging your mom’s back-end.
Comment by William "The Ownage" Bowen on 4 December 2007:
That’s ok because I already checked all my code into your mom’s repository.
And I expect to be pushing some more code tomorrow night.
Comment by William "The Ownage" Bowen on 4 December 2007:
Also -
I had an atomic grouping with your mom and some friends, but her lazy repetition was not impressing me. Then when I was done she became a bit of a possessive quantifier so I finished the job with $.
Comment by Steve on 4 December 2007:
Your mom’s repository is so old and easy that I don’t need to use version control.
As for your regex dirty-talk, that’s just dreadful, but I’ve got nothing.
Comment by William "The Ownage" Bowen on 4 December 2007:
Haha, it was a bit of a stretch. But I did come up with some more generalized geek talk ones:
Last night I inserted my Dongle into your mom’s hub but I didn’t use my Trojan.
I spent all morning servicing your mom’s asynchronous requests. On an unrelated note I heard some guy invoked the getPenis() method of your service and received a 404 status code - Not found.
I think your mom’s cache is going to need some clearing because I just filled it.
Comment by liorean on 5 December 2007:
^^ That was just dreadful!
Comment by Arthur Dent on 31 January 2008:
That’s just friggin hillarious. Myself, if I gotta debug a chick (or her clothes), she ain’t worth it.
Comment by Peter Lorre on 26 March 2008:
debugging girls?? Methinks you need to de-louse her first… creepy ;-)