From: ishamid Date: 2006-12-03T02:45:08+09:00 Subject: search and replace [total novice here] Hi, I have a series of expressions like this (shortened from verbose xml) ===================== [1 [2 [3 [4 ===================== I want to globally replace each such line with just ==================== \head ==================== followed by a line space so I get ==================== \head \head \head \head ==================== etc. I am modifying a script with lines like ==================== data.gsub!(/.*?<(office:text).*?>(.*?)<\/\1>.*/mois) do '\starttext' + "\n" + $2 + "\n" + '\stoptext' ==================== and don't yet know enough to completely understand. Probably a few more hours/days of study will get me there but I need this urgently so... THNX in advance Best Idris