This tutorial explains how you can add regular expression pattern matching into your HTML to help with form validation.
Sorry for the background noise with my dog pushing my office door open, then pushing it closed and trapping himself inside while I was recording.
Code from video: https://gist.github.com/prof3ssorSt3v...
Browser support: https://caniuse.com/?search=pattern
Regular Expression website: https://regexr.com/