in reply to Pattern Matching

I see a couple of issues.. First, I would anchor the pattern to the front of the string by using a '^'. Secondly, the '\.' states that you are looking for an actual '.' rather than the set represented by a '.' in regexs. I would do something like: /^0{4,}./ The $' will now hold everything beyond the first non-zero character (specifically not including the first non-zero character). Also, I get an error when I try to "chop" $'. Hope this helps.