I'm facing a problem where I would like to give an user an immediate feedback that an input field already doesn't comply following a validation pattern and not after providing the whole value.
To give you an example: UK postcode might look like this [SW1W 0NY] and I would like to inform the user that everything looks good so far when he enters [SW] but give him immediate feedback when he enters for example [1].
How would you approach this? Since UK postcode can be up to 7 numbers I don't want to create 7 regular expressions to check the postcode against based on the postcode length but rather have some 'feedforward' machanism.