From: "David A. Black" Date: 2005-04-28T19:20:37+09:00 Subject: Re: Scanning a String On Thu, 28 Apr 2005, David A. Black wrote: > Just to add a possible variant: depending how you want to handle three > or more vowels in a row, you might want to do: > > pious".gsub(/([aeiou])(?=[aeiou])/) { "#{$1}'#{$2}" } > > which will result in: pi'o'us I managed to omit the " before pious... and also, I didn't actually need #{$2} in there. In fact, $2 is nil (because ?= isn't captured). So.... "pious".gsub(/([aeiou])(?=[aeiou])/) { "#{$1}'" } David -- David A. Black dblack@wobblini.net