It's what's called a "regular expression", a fancy name for a limited type of pattern definition, and it's in the syntax of the Perl programming language. Perl Regular expressions were the best way of specifying patterns for a long time, so other languages 'stole' the Perl syntax, including PHP (hence slimjim getting it), and JavaScript.
Lets break it down:
the / on each end just denotes the start and end of the pattern, so you can mentally strip those away to leave just:
bb|[^b]{2}
the first bit is easy, bb is the patern of the letter b followed by the letter b - i.e. two bees, or "to be".
The vertical bar is the symbol for 'OR', so we get "to be or ".
Then things get a bit messier, anything inside [] defines a list of allowed characters, and ^ means that the list should be inverted, so [^b] means "anything that's not a b", or 'not b'.
Finally, a number inside {} denotes how many of what ever came before should be in the pattern, so {2} means two of what ever came before, which in this case is [^b], so 'not to be'.
Put it all together and you get "to be or not to be" as a Perl regular expression.
If you were to use the code for real it would match any piece of text that contained two b characters followed by two of anything else.
Yes, it's very very nerdy, and you can spot a Perl programmer a mile away because it'll take him a second at most to get what that means
BTW - regular expressions are very useful, if you want to validate that someone entered a social security number into a text field and not something else, you could use this RE:
/^\d{3}\-\d{2}\-\d{4}$/
which means "the start of the string (^), followed by three digits (\d{3}), followed by a dash (\-), followed by two digits (\d{2}), followed by a dash (\-), followed by four digits (\d{4}), followed by the end of the string ($)".
You use the same to check email addresses, URLs, time, date, and so on and so forth.
B.