You can try pattern validation using reactive forms for eg:- export const MNC = '^([0-9][0-9][0-9]|[0-9][0-9])$'; export const MCC = /^(001|999|[2-7][0-9]{2})$/; You can use above to match for these validations.