From: Robert Klemme Date: 2008-02-26T06:39:55+09:00 Subject: Re: regex and lookahead to specific number of chars On 25.02.2008 21:28, Adam Akhtar wrote: > If I have a string such as > "I love ruby, i really do love ruby, oh yes i do blah blah blah" > > and i want to insert an asterix at every 10th char whether its a > whitespace, digit whatever how do i go about it > > i was trying > > string.gsub!(/[.]{10}/, "*") > > but it doesnt work > > any hints??? Remove the square brackets around the dot. The dot is meta only outside of them. Cheers robert