I am trying to add a custom mask in angular using regular expression.
Here is the mask I want:
Characters allowed: Capital Letters, Small Letters, and Numbers
Length of the field: 20
Can start the input using an alphabet and number as well.
WHAT I TRIED!
public customPatterns = { 'X': { pattern: new RegExp('\[a-zA-Z0-9\]')} };
<input formControlName ="number" matInput placeholder="Number" mask="X{20}">
PROBLEM I AM FACING!
Using the above expression, I am able to write only numbers. I am not able to right any alphabet character neither at the start nor in the middle.