Check out example codes for "canadian postal code pattern input html". It will help you in understanding the concepts better.

Code Example 1

[A-Za-z][0-9][A-Za-z] [0-9][A-Za-z][0-9]

Learn ReactJs, React Native from akashmittal.com