I don't think you can do it with just a simple regexp, if you are in Linux then it may take a shell script of some kind. There is too much logic involved for it to run using a simple regexp. -- /chris chris at fuzzylizard.com ICQ: 157753590 <www.fuzzylizard.com>