From: Nuralanur@... Date: 2006-07-12T23:28:07+09:00 Subject: Re: Help with a regexp -------------------------------1152714473 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit Daniel, here's a function to do what you want ... class String def bencode? if /^([1-9]+\d*):/.match(self)==nil return false else number=eval((/(^([1-9]+\d*)):/.match(self))[1]) rest_of_string_length=self[self.index(':')+1..-1].length if number==rest_of_string_length return true else return false end end end end Best regards, Axel -------------------------------1152714473--