A string formatter and validator based on masks.