Jens Wille wrote:
> Peter Bailey [2008-04-09 20:04]:
>> output = file.gsub(%r{^(<row><entry><text><emph 
>> face="b">)(.*)(<\/emph>)}m) do |match| 
>>   "#{$1}#{$2.gsub(%r{\b\w+\b}){|w|w.capitalize}}#{$3}"
>> end
> oh, and for the fun of it, here's what you can do with oniguruma:
> 
>   Oniguruma::ORegexp.new(
>     '(?<=^<row><entry><text><emph face="b">).+(?=</emph>)', 'm'
>   ).gsub(file) { |md|
>     md[0].gsub(%r{\b\w+\b}) { |w| w.capitalize }
>   }
> 
> (note that i needed to change '.*' to '.+')
> 
> cheers
> jens

Sorry, Jens, but, I have no idea what you're referring to here. I 
googled oniguruma. I see what it is. I installed it, but, it didn't seem 
to install successfully. Do I do a "require oniguruma" at the top of my 
script?
-- 
Posted via http://www.ruby-forum.com/.