Validation and Verification : Format Check

A format check is a validation check which ensures that entered data is in a particular format or pattern. The format that data must be in is specified using an input mask. The input mask is made up of special characters which indicate what characters may be typed where.

In a particular database the following special characters can be used to define an input mask :

Here are some input masks that could be used to validate three letter codes, car registration numbers and postcodes.

Input Mask Purpose Valid Data Invalid Data
LLLThree Letter CodeABC
AND
OLD
AB
B2H
ABCD
LL00LLLCar Registration NumberAB01CDE
DH53MAN
AB1CDE
HELLO
A823HFA
Ll90 0LLPostcodeWA14 9JD
M90 4SJ
BL9 0HN
WAM4 9PM
WA6 13H
M12 9Q

GCSE ICT Companion 04 - (C) P Meakin 2004