From: Li Chen Date: 2007-08-04T06:34:24+09:00 Subject: Re: How to find out the number of pattern matched? Sebastian Hungerecker wrote: > Li Chen wrote: > >> I search a pattern in a string. How do I know how many times the pattern >> is found/matched? > > string.scan(pattern).length > > HTH, > Sebastian Thanks, Li -- Posted via http://www.ruby-forum.com/.