Flagrant Badassery

A JavaScript and regular expression centric blog

/(bb|[^b]{2})/

/(bb|[^b]{2})/

…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.

There Are 10 Responses So Far. »

  1. /bb|(?!bb).*/

  2. 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.

  3. Yeah, well, I was worn out from debugging your mom’s back-end.

  4. 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.

  5. 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 $.

  6. 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.

  7. 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.

  8. ^^ That was just dreadful!

  9. That’s just friggin hillarious. Myself, if I gotta debug a chick (or her clothes), she ain’t worth it.

  10. debugging girls?? Methinks you need to de-louse her first… creepy ;-)

Post a Response

If you are about to post code, please escape your HTML entities (&, >, <).