David. Many thanks, once again. At 06:30 AM 1/11/2003 +0900, you wrote: >I would use String#gsub: :-) > > s2 = s1.gsub(/\{\\(\S+)\s([^}]*)\}/) do |s| > tag = subs[$1] || $1 > "<#{tag}>#{$2}</#{tag}>" > end Ruby continues to amaze me! I didn't know that you could do that. A much more elegant solution than mine. Regards, -mark.