Damn, of course it had to be a regex problem, d'oh! I'll try to cobble something together.