William James wrote:

> You said that you wanted to count all dollar signs except the
> escaped ones.  So the correct answer is 2.  The first backslash
> escapes the second one, which escapes nothing.

Yes, thanks, I realize now. 1 was the answer I would have wanted because 
it wasn't preceded by a space, but I could have made that much clearer 
in my question.

Thanks a lot guys. You've been most helpful. Have loads more basic 
questions like that. Is this the right forum for such questions?
-- 
Posted via http://www.ruby-forum.com/.