Format html inputs to match a specified pattern