Terry Woods
asked on
Regular expression for "To be or not to be"... just for fun
I've seen a t-shirt design where the text on the front is:
However, I think the pattern:
probably is a more accurate translation of the phrase. Thoughts?
Are there any other witty regular expression patterns out there?
The only other one I remember seeing is something like: s/microsoft/linux/gi
/bb|[^b]{2}/
which is meant to be a witty version of "To be or not to be". Pretty clever...However, I think the pattern:
/bb|(?!bb)/
probably is a more accurate translation of the phrase. Thoughts?
Are there any other witty regular expression patterns out there?
The only other one I remember seeing is something like: s/microsoft/linux/gi
This might get you angry looks from girls:
(?![0-57-9])\d[^\D0-8]\?
but again, if a girl can read that, chances are the invite was not for her...
ASKER
The first pattern I read as "2b's or 2 not-b's"...
Thanks, though I don't think I'd wear your suggestion on my chest! I suppose it could be modified to something like this with extra geeky meaning (wouldn't look so good in PHP... maybe a javascript version would look ok?):
Thanks, though I don't think I'd wear your suggestion on my chest! I suppose it could be modified to something like this with extra geeky meaning (wouldn't look so good in PHP... maybe a javascript version would look ok?):
$life['meaning'] = /(?![0-35-9])\d[^\D013-9]/
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Your pattern reads "2 bs or/alternate not 2 bs ahead". Rearranging it's "2 b or not 2 b ahead". More of a sports line.
HTH,
Dan