Wow... You guys are just having too much fun with "(5d5-4)d(16/d4)+3", I think. Heck, if y'all know Ruby so well (more than me, cause I'm still such a n00b), you'd be able to swap in loaded dice for random dice and get your min's and max's. =) Anyway, I just wanted to add a couple of notes. It was made aware to me that the simplified BNF (in the original post) is slightly in error, in that it allows expressions like this: 3dddd6 which is invalid. A couple possible fixes: 1. Use the expanded BNF I posted, which doesn't have this fault. 2. Implement your dice parser using right-associativity for 'd' operators (but maintain left-assoc for the other binary operators). Feel free to do what you like.