I need the correct regular expression pattern, for checking input text in HTML matching this format:
Start with a capital letter
End with the character $
Between the initial capital letter and the final dollar character there may be:
- Letter between a and z (both included) uppercase or lowercase
- Digit from zero to nine (two included)
- The underscore character ( _ )
Example: B4rc3l0nA$, Fr4_nc3$, A$
I think I have to add anchors at the beginning and at the end, but I don't know how to join everything so that the complete regular expression remains.
<input type="text" placeholder="Your password" pattern="^\[a-z]i\s-\s[0-9]{2}\([a-z]{1,3})$" required>