minor rewrite for double escaping and regex v division