Jason  Vogel wrote:
> Disclaimer : Ruby Nuby and I don't know RegEx basically at all.  I know
> RegEx is the answer, just don't know where to start.
>
> Current Source:
>    str.split(' ').each {|w| w.capitalize!}.join(' ')
>
> Text:
>    ADDITIONAL SPA (ONLY AVAILABLE W/PURCHASE OF POOL OR SPA)
>    SELLER HEAT/AC/DUCTWORK
>
> Result:
>    Additional Spa (only Available W/purchase Of Pool Or Spa)
>    Seller Heat/ac/ductwork
>
> Desired:
>    Additional Spa (Only Available w/Purchase of Pool or Spa)
>    Seller Heat/AC/Ductwork
>
> Isssus:
>   - Need to capitalize after a "/'
>   - Need specific word case handling (e.g. "Ac" => "AC","or" => "or",
> "w/[a]" => "w/[A]")
>
> Thanks,
> Jason

specials = %w( of or w AC ).
inject({}){|h,s| h.update({s.downcase,s}) }

puts DATA.read.downcase.split( /([^a-z]+)/ ).map{|s|
  specials[s] or s.capitalize }.join

__END__
ADDITIONAL SPA  (ONLY AVAILABLE W/PURCHASE OF POOL OR SPA)
SELLER HEAT/AC/DUCTWORK


---  output  -----
Additional Spa  (Only Available w/Purchase of Pool or Spa)
Seller Heat/AC/Ductwork