How to set a regular expression for an input element value that checked against using HTML ? Last Updated : 25 Dec, 2020 Comments Improve Suggest changes 1 Likes Like Report In this article, we will use <input> pattern attribute to set the regular expression pattern for an input field that checked against. The HTML <input> pattern attribute is used to specify the regular expression on which the input elements value is checked against. This attribute works with the following input types: text, password, date, search, email, etc. Use the Global title attribute to describe the pattern for helping the user. Syntax: <input pattern = "regular_exp"> Attribute Value: The pattern attribute is used to set the pattern of regular expression that enters into the input field. Example: This example illustrates the use of pattern attribute in <input> element. HTML <!DOCTYPE html> <html> <head> <title> How to specify a regular expression that an input element's value is checked against? </title> </head> <body style="text-align: center;"> <h1 style="color: green;"> GeeksforGeeks </h1> <h3> How to specify a regular expression that an input <br>element's value is checked against? </h3> <form action="#"> Name: <input type="text" name="Password" pattern="[A-Za-z]{10}" title="Three letter Password"> <input type="submit"> </form> </body> </html> Output: Supported Browsers: The browser supported by HTML <input> pattern attribute are listed below: Google Chrome 5.0Internet Explorer 10.0Firefox 4.0Safari 10.1Opera 9.6 Create Quiz Comment V vkash8574 Follow 1 Improve V vkash8574 Follow 1 Improve Article Tags : Web Technologies HTML HTML-Questions Explore HTML BasicsHTML Introduction4 min readHTML Editors4 min readHTML Basics7 min readStructure & ElementsHTML Elements4 min readHTML Attributes7 min readHTML Headings3 min readHTML Paragraphs3 min readHTML Text Formatting4 min readHTML Block and Inline Elements3 min readHTML Charsets4 min readListsHTML Lists3 min readHTML Ordered Lists5 min readHTML Unordered Lists4 min readHTML Description Lists3 min readVisuals & MediaHTML Colors11 min readHTML Links Hyperlinks2 min readHTML Images7 min readHTML Favicon4 min readHTML Video4 min readLayouts & DesignsHTML Tables9 min readHTML Iframes4 min readHTML Layout4 min readHTML File Paths3 min readProjects & Advanced TopicsHTML Forms4 min readHTML5 Semantics5 min readHTML URL Encoding4 min readHTML Responsive Web Design11 min readTop 10 Projects For Beginners To Practice HTML and CSS Skills8 min readTutorial ReferencesHTML Tags - A to Z List5 min readHTML Attributes Complete Reference8 min readHTML Global Attributes5 min readHTML5 Complete Reference8 min readHTML5 MathML Complete Reference3 min readHTML DOM Complete Reference15+ min readHTML DOM Audio/Video Complete Reference2 min readSVG Element Complete Reference5 min readSVG Attribute Complete Reference8 min readSVG Property Complete Reference7 min readHTML Canvas Complete Reference4 min read Like