Safely parse formats.