oops. i've only been using this on linux. mac os x sed doesnt have a case insensitive flag after replace pattern and throws an error! sorry.