I use Rubular a lot, it's great!

Thanks for the ideas. I've decided to loop through the file using 2 
variables, similarly to Derrick's suggestion.

Nice trick with "\1" Chris, I haven't tried using that inside the same 
expression before. I'll see whether I can use that in this instance.

I was wondering whether Ruby's Regexp had this kind of option built in, 
but I guess this scenario is more on the conditional side of 
programming.

-- 
Posted via http://www.ruby-forum.com/.