Improved validation
Check if character is a format character AND valid for that format
Updated version