Check out example codes for "html input regex". It will help you in understanding the concepts better.

Code Example 1

<input type="text" name="Phone Number" pattern="[7-9]{1}[0-9]{9}" 
       title="Phone number with 7-9 and remaing 9 digit with 0-9">

Code Example 2

<input type="text" pattern="[A-Za-z]{3}">

Learn ReactJs, React Native from akashmittal.com