Subject: Re: Return number of matches
From: ThoML <micathom gmail.com>
Date: Tue, 12 Feb 2008 18:49:55 +0900
References: 290678290680290725290786
> string.scan(/[^\\]\$/).size
This fails on input like "$$$$", since the string will be split into "$
$", "$$". It will also not find the first $ in the string but this
could be amended by using (^|[^\\]).