<div class="bottomcontainerBox" style="border:1px solid #808080;background-color:#F0F4F9;">
			<div style="float:left; width:85px;padding-right:10px; margin:4px 4px 4px 4px;height:30px;">
			<iframe src="http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Fshabeebk.com%2Fblog%2Fregular-expression-for-at-least-one-number-capital-letter-and-a-special-character%2F&amp;layout=button_count&amp;show_faces=false&amp;width=85&amp;action=like&amp;font=verdana&amp;colorscheme=light&amp;height=21" scrolling="no" frameborder="0" allowTransparency="true" style="border:none; overflow:hidden; width:85px; height:21px;"></iframe></div>
			<div style="float:left; width:80px;padding-right:10px; margin:4px 4px 4px 4px;height:30px;">
			<g:plusone size="medium" href="http://shabeebk.com/blog/regular-expression-for-at-least-one-number-capital-letter-and-a-special-character/"></g:plusone>
			</div>
			<div style="float:left; width:95px;padding-right:10px; margin:4px 4px 4px 4px;height:30px;">
			<a href="http://twitter.com/share" class="twitter-share-button" data-url="http://shabeebk.com/blog/regular-expression-for-at-least-one-number-capital-letter-and-a-special-character/"  data-text="Regular expression for at least one number capital letter and a special character" data-count="horizontal"></a>
			</div><div style="float:left; width:105px;padding-right:10px; margin:4px 4px 4px 4px;height:30px;"><script type="in/share" data-url="http://shabeebk.com/blog/regular-expression-for-at-least-one-number-capital-letter-and-a-special-character/" data-counter="right"></script></div>			
			<div style="float:left; width:85px;padding-right:10px; margin:4px 4px 4px 4px;height:30px;"><script src="http://www.stumbleupon.com/hostedbadge.php?s=1&amp;r=http://shabeebk.com/blog/regular-expression-for-at-least-one-number-capital-letter-and-a-special-character/"></script></div>			
			</div><div style="clear:both"></div><div style="padding-bottom:4px;"></div>{"id":171,"date":"2014-12-18T10:18:57","date_gmt":"2014-12-18T10:18:57","guid":{"rendered":"http:\/\/shabeebk.com\/blog\/?p=171"},"modified":"2014-12-21T11:26:27","modified_gmt":"2014-12-21T11:26:27","slug":"regular-expression-for-at-least-one-number-capital-letter-and-a-special-character","status":"publish","type":"post","link":"http:\/\/shabeebk.com\/blog\/regular-expression-for-at-least-one-number-capital-letter-and-a-special-character\/","title":{"rendered":"Regular expression for at least one number capital letter and a special character"},"content":{"rendered":"<p><br \/>\nHere we are going to write a regular exprestion for Password to check the condition like , password must contain at least one number,one capital letter and one special character.<\/p>\n<p>First we can write Regex as below,<\/p>\n<pre class=\"whitespace-before:2 whitespace-after:2 lang:default decode:true \" >^(((.*\\d.*[A-Z].*[!@#$%^&amp;amp;*? ~].*))|(.*[A-Z].*\\d.*[!@#$%^&amp;amp;*? ~].*)|(.*[!@#$%^&amp;amp;*? ~].*[A-Z].*\\d.*)|(.*[!@#$%^&amp;amp;*? ~].*\\d.*[A-Z].*))$<\/pre>\n<p>This will check the string contain at at least one number,one capital letter and one special character,<\/p>\n<p>Here i am going to show examples with  Javascript function  ,<\/p>\n<p>We can write a function in javascript as below <\/p>\n<pre class=\"whitespace-before:2 whitespace-after:2 lang:default decode:true \" > function validatePassword(str)\r\n            {\r\n                \/\/ patter to match : Atleast one number ,one capital letter, one special charector\r\n                var reg = \/^(((.*\\d.*[A-Z].*[!@#$%^&amp;amp;amp;*? ~].*))|(.*[A-Z].*\\d.*[!@#$%^&amp;amp;amp;*? ~].*)|(.*[!@#$%^&amp;amp;amp;*? ~].*[A-Z].*\\d.*)|(.*[!@#$%^&amp;amp;amp;*? ~].*\\d.*[A-Z].*))$\/;\r\n                if (reg.test(str)) {\r\n                    return true;                                     \r\n                }\r\n                else {\r\n                    return false;                  \r\n                }\r\n            }<\/pre>\n<p>and we can pass the string as function argument &#8220;str&#8221;, It will return if it matches the condition else it will return false.<\/p>\n<p>Let us look on the demo <\/p>\n<style>    \n     .valid_class{\n        color: #8AC007; \n        padding: 10px 10px ;\n    }\n    .error_class{\n        color: red;  \n         padding: 10px 10px ;\n    }\n<\/style>\n<div>\n<h2> Javascript function sample<\/h2>\n<\/div>\n<p>  <script>\n            function validatePassword(password)\n            {\n                \/\/ patter to match : Atleast one number ,one capital letter, one special charector\n                var reg = \/^(((.*\\d.*[A-Z].*[!@#$%^&*? ~].*))|(.*[A-Z].*\\d.*[!@#$%^&*? ~].*)|(.*[!@#$%^&*? ~].*[A-Z].*\\d.*)|(.*[!@#$%^&*? ~].*\\d.*[A-Z].*))$\/;\n                if (reg.test(password)) {\n                    \/\/return true;\n                    document.getElementById(\"error_msg2\").innerHTML=\"<span class=\\\"valid_class\\\">valid password<\/span>\";<\/p>\n<p>                }\n                else {\n                   \/\/ return false;\n                     document.getElementById(\"error_msg2\").innerHTML=\"<span class=\\\"error_class\\\">password must contain at least one number,one capital letter and one special character<\/span> \";\n                }\n            }<\/p>\n<p>        <\/script><\/p>\n<form>\n     Enter password :  <input type=\"text\" name=\"password\" onkeyup=\"validatePassword(this.value)\" ><br \/>\n            <label id=\"error_msg2\"><\/label><\/p>\n<p>            <input type=\"button\" value=\"Submit\"><br \/>\n        <\/form>\n<p>Let us look a jquery demo<\/p>\n<div>\n<h2> Jquery  sample<\/h2>\n<\/div>\n<p><!-- jquery sample ---><\/p>\n<form>\n            Enter password :  <input type=\"text\" name=\"password\" id=\"mypass\" ><br \/>\n            <label id=\"error_msg\"><\/label><\/p>\n<p>            <input type=\"button\" value=\"Submit\"><br \/>\n        <\/form>\n<p>        <script src=\"\/\/ajax.googleapis.com\/ajax\/libs\/jquery\/1.11.1\/jquery.min.js\"><\/script><\/p>\n<p>        <script>\n            $(document).ready(function() {\n                $('#mypass').on('keyup', function() {\n                    password = $(this).val();\n                    var reg = \/^(((.*\\d.*[A-Z].*[!@#$%^&*? ~].*))|(.*[A-Z].*\\d.*[!@#$%^&*? ~].*)|(.*[!@#$%^&*? ~].*[A-Z].*\\d.*)|(.*[!@#$%^&*? ~].*\\d.*[A-Z].*))$\/;\n                    if (reg.test(password)) {\n                        $('#error_msg').html(\"<span class=\\\"valid_class\\\">valid password<\/span>\");\n                    }\n                    else {\n                        $('#error_msg').html(\"<span class=\\\"error_class\\\">password must contain at least one number,one capital letter and one special character<\/span>\");\n                    }\n                });<\/p>\n<p>            });<\/p>\n<p> <\/script><\/p>\n<p> You can download from   <a href=\"https:\/\/github.com\/shabeeb\/regex-password-validation\/\" target=\"_password_regex\">github <\/a><\/p>\n<p><\/p>\n<p>Have a noce day \ud83d\ude09<\/p>\n<div class=\"pvc_clear\"><\/div>\n<p class=\"pvc_stats all \" data-element-id=\"171\" style=\"\"><i class=\"pvc-stats-icon medium\" aria-hidden=\"true\"><svg aria-hidden=\"true\" focusable=\"false\" data-prefix=\"far\" data-icon=\"chart-bar\" role=\"img\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" viewBox=\"0 0 512 512\" class=\"svg-inline--fa fa-chart-bar fa-w-16 fa-2x\"><path fill=\"currentColor\" d=\"M396.8 352h22.4c6.4 0 12.8-6.4 12.8-12.8V108.8c0-6.4-6.4-12.8-12.8-12.8h-22.4c-6.4 0-12.8 6.4-12.8 12.8v230.4c0 6.4 6.4 12.8 12.8 12.8zm-192 0h22.4c6.4 0 12.8-6.4 12.8-12.8V140.8c0-6.4-6.4-12.8-12.8-12.8h-22.4c-6.4 0-12.8 6.4-12.8 12.8v198.4c0 6.4 6.4 12.8 12.8 12.8zm96 0h22.4c6.4 0 12.8-6.4 12.8-12.8V204.8c0-6.4-6.4-12.8-12.8-12.8h-22.4c-6.4 0-12.8 6.4-12.8 12.8v134.4c0 6.4 6.4 12.8 12.8 12.8zM496 400H48V80c0-8.84-7.16-16-16-16H16C7.16 64 0 71.16 0 80v336c0 17.67 14.33 32 32 32h464c8.84 0 16-7.16 16-16v-16c0-8.84-7.16-16-16-16zm-387.2-48h22.4c6.4 0 12.8-6.4 12.8-12.8v-70.4c0-6.4-6.4-12.8-12.8-12.8h-22.4c-6.4 0-12.8 6.4-12.8 12.8v70.4c0 6.4 6.4 12.8 12.8 12.8z\" class=\"\"><\/path><\/svg><\/i> &nbsp;15,111&nbsp;total views, &nbsp;2&nbsp;views today<\/p>\n<div class=\"pvc_clear\"><\/div>\n","protected":false},"excerpt":{"rendered":"<p>Here we are going to write a regular exprestion for Password to check the condition like , password must contain at least one number,one capital letter and one special character. First we can write Regex as below, ^(((.*\\d.*[A-Z].*[!@#$%^&amp;amp;*? ~].*))|(.*[A-Z].*\\d.*[!@#$%^&amp;amp;*? ~].*)|(.*[!@#$%^&amp;amp;*? ~].*[A-Z].*\\d.*)|(.*[!@#$%^&amp;amp;*? ~].*\\d.*[A-Z].*))$ This will check the string contain at at least one number,one capital letter [&hellip;]<\/p>\n<div class=\"pvc_clear\"><\/div>\n<p class=\"pvc_stats all \" data-element-id=\"171\" style=\"\"><i class=\"pvc-stats-icon medium\" aria-hidden=\"true\"><svg aria-hidden=\"true\" focusable=\"false\" data-prefix=\"far\" data-icon=\"chart-bar\" role=\"img\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" viewBox=\"0 0 512 512\" class=\"svg-inline--fa fa-chart-bar fa-w-16 fa-2x\"><path fill=\"currentColor\" d=\"M396.8 352h22.4c6.4 0 12.8-6.4 12.8-12.8V108.8c0-6.4-6.4-12.8-12.8-12.8h-22.4c-6.4 0-12.8 6.4-12.8 12.8v230.4c0 6.4 6.4 12.8 12.8 12.8zm-192 0h22.4c6.4 0 12.8-6.4 12.8-12.8V140.8c0-6.4-6.4-12.8-12.8-12.8h-22.4c-6.4 0-12.8 6.4-12.8 12.8v198.4c0 6.4 6.4 12.8 12.8 12.8zm96 0h22.4c6.4 0 12.8-6.4 12.8-12.8V204.8c0-6.4-6.4-12.8-12.8-12.8h-22.4c-6.4 0-12.8 6.4-12.8 12.8v134.4c0 6.4 6.4 12.8 12.8 12.8zM496 400H48V80c0-8.84-7.16-16-16-16H16C7.16 64 0 71.16 0 80v336c0 17.67 14.33 32 32 32h464c8.84 0 16-7.16 16-16v-16c0-8.84-7.16-16-16-16zm-387.2-48h22.4c6.4 0 12.8-6.4 12.8-12.8v-70.4c0-6.4-6.4-12.8-12.8-12.8h-22.4c-6.4 0-12.8 6.4-12.8 12.8v70.4c0 6.4 6.4 12.8 12.8 12.8z\" class=\"\"><\/path><\/svg><\/i> &nbsp;15,111&nbsp;total views, &nbsp;2&nbsp;views today<\/p>\n<div class=\"pvc_clear\"><\/div>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"spay_email":""},"categories":[4,14,16,1],"tags":[17,53],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v18.4.1 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Regular expression for at least one number capital letter and a special character - shabeeb Blog<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"http:\/\/shabeebk.com\/blog\/regular-expression-for-at-least-one-number-capital-letter-and-a-special-character\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Regular expression for at least one number capital letter and a special character - shabeeb Blog\" \/>\n<meta property=\"og:description\" content=\"Here we are going to write a regular exprestion for Password to check the condition like , password must contain at least one number,one capital letter and one special character. First we can write Regex as below, ^(((.*\\d.*[A-Z].*[!@#$%^&amp;amp;*? ~].*))|(.*[A-Z].*\\d.*[!@#$%^&amp;amp;*? ~].*)|(.*[!@#$%^&amp;amp;*? ~].*[A-Z].*\\d.*)|(.*[!@#$%^&amp;amp;*? ~].*\\d.*[A-Z].*))$ This will check the string contain at at least one number,one capital letter [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"http:\/\/shabeebk.com\/blog\/regular-expression-for-at-least-one-number-capital-letter-and-a-special-character\/\" \/>\n<meta property=\"og:site_name\" content=\"shabeeb Blog\" \/>\n<meta property=\"article:published_time\" content=\"2014-12-18T10:18:57+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2014-12-21T11:26:27+00:00\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"shabeeb\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"1 minute\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebSite\",\"@id\":\"http:\/\/shabeebk.com\/blog\/#website\",\"url\":\"http:\/\/shabeebk.com\/blog\/\",\"name\":\"shabeeb Blog\",\"description\":\"A developer blog\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"http:\/\/shabeebk.com\/blog\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"en-US\"},{\"@type\":\"WebPage\",\"@id\":\"http:\/\/shabeebk.com\/blog\/regular-expression-for-at-least-one-number-capital-letter-and-a-special-character\/#webpage\",\"url\":\"http:\/\/shabeebk.com\/blog\/regular-expression-for-at-least-one-number-capital-letter-and-a-special-character\/\",\"name\":\"Regular expression for at least one number capital letter and a special character - shabeeb Blog\",\"isPartOf\":{\"@id\":\"http:\/\/shabeebk.com\/blog\/#website\"},\"datePublished\":\"2014-12-18T10:18:57+00:00\",\"dateModified\":\"2014-12-21T11:26:27+00:00\",\"author\":{\"@id\":\"http:\/\/shabeebk.com\/blog\/#\/schema\/person\/71832abe654179971635c65c09bceb29\"},\"breadcrumb\":{\"@id\":\"http:\/\/shabeebk.com\/blog\/regular-expression-for-at-least-one-number-capital-letter-and-a-special-character\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"http:\/\/shabeebk.com\/blog\/regular-expression-for-at-least-one-number-capital-letter-and-a-special-character\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"http:\/\/shabeebk.com\/blog\/regular-expression-for-at-least-one-number-capital-letter-and-a-special-character\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"http:\/\/shabeebk.com\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Regular expression for at least one number capital letter and a special character\"}]},{\"@type\":\"Person\",\"@id\":\"http:\/\/shabeebk.com\/blog\/#\/schema\/person\/71832abe654179971635c65c09bceb29\",\"name\":\"shabeeb\",\"image\":{\"@type\":\"ImageObject\",\"@id\":\"http:\/\/shabeebk.com\/blog\/#personlogo\",\"inLanguage\":\"en-US\",\"url\":\"http:\/\/0.gravatar.com\/avatar\/9998389cc76a77663881c48f7d4cbba0?s=96&d=mm&r=g\",\"contentUrl\":\"http:\/\/0.gravatar.com\/avatar\/9998389cc76a77663881c48f7d4cbba0?s=96&d=mm&r=g\",\"caption\":\"shabeeb\"},\"description\":\"Developer,Entrepreneur, software engineer more than that a human being\",\"sameAs\":[\"http:\/\/shabeebk.com\/blog\"],\"url\":\"http:\/\/shabeebk.com\/blog\/author\/admin\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Regular expression for at least one number capital letter and a special character - shabeeb Blog","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"http:\/\/shabeebk.com\/blog\/regular-expression-for-at-least-one-number-capital-letter-and-a-special-character\/","og_locale":"en_US","og_type":"article","og_title":"Regular expression for at least one number capital letter and a special character - shabeeb Blog","og_description":"Here we are going to write a regular exprestion for Password to check the condition like , password must contain at least one number,one capital letter and one special character. First we can write Regex as below, ^(((.*\\d.*[A-Z].*[!@#$%^&amp;amp;*? ~].*))|(.*[A-Z].*\\d.*[!@#$%^&amp;amp;*? ~].*)|(.*[!@#$%^&amp;amp;*? ~].*[A-Z].*\\d.*)|(.*[!@#$%^&amp;amp;*? ~].*\\d.*[A-Z].*))$ This will check the string contain at at least one number,one capital letter [&hellip;]","og_url":"http:\/\/shabeebk.com\/blog\/regular-expression-for-at-least-one-number-capital-letter-and-a-special-character\/","og_site_name":"shabeeb Blog","article_published_time":"2014-12-18T10:18:57+00:00","article_modified_time":"2014-12-21T11:26:27+00:00","twitter_misc":{"Written by":"shabeeb","Est. reading time":"1 minute"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebSite","@id":"http:\/\/shabeebk.com\/blog\/#website","url":"http:\/\/shabeebk.com\/blog\/","name":"shabeeb Blog","description":"A developer blog","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"http:\/\/shabeebk.com\/blog\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"en-US"},{"@type":"WebPage","@id":"http:\/\/shabeebk.com\/blog\/regular-expression-for-at-least-one-number-capital-letter-and-a-special-character\/#webpage","url":"http:\/\/shabeebk.com\/blog\/regular-expression-for-at-least-one-number-capital-letter-and-a-special-character\/","name":"Regular expression for at least one number capital letter and a special character - shabeeb Blog","isPartOf":{"@id":"http:\/\/shabeebk.com\/blog\/#website"},"datePublished":"2014-12-18T10:18:57+00:00","dateModified":"2014-12-21T11:26:27+00:00","author":{"@id":"http:\/\/shabeebk.com\/blog\/#\/schema\/person\/71832abe654179971635c65c09bceb29"},"breadcrumb":{"@id":"http:\/\/shabeebk.com\/blog\/regular-expression-for-at-least-one-number-capital-letter-and-a-special-character\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["http:\/\/shabeebk.com\/blog\/regular-expression-for-at-least-one-number-capital-letter-and-a-special-character\/"]}]},{"@type":"BreadcrumbList","@id":"http:\/\/shabeebk.com\/blog\/regular-expression-for-at-least-one-number-capital-letter-and-a-special-character\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"http:\/\/shabeebk.com\/blog\/"},{"@type":"ListItem","position":2,"name":"Regular expression for at least one number capital letter and a special character"}]},{"@type":"Person","@id":"http:\/\/shabeebk.com\/blog\/#\/schema\/person\/71832abe654179971635c65c09bceb29","name":"shabeeb","image":{"@type":"ImageObject","@id":"http:\/\/shabeebk.com\/blog\/#personlogo","inLanguage":"en-US","url":"http:\/\/0.gravatar.com\/avatar\/9998389cc76a77663881c48f7d4cbba0?s=96&d=mm&r=g","contentUrl":"http:\/\/0.gravatar.com\/avatar\/9998389cc76a77663881c48f7d4cbba0?s=96&d=mm&r=g","caption":"shabeeb"},"description":"Developer,Entrepreneur, software engineer more than that a human being","sameAs":["http:\/\/shabeebk.com\/blog"],"url":"http:\/\/shabeebk.com\/blog\/author\/admin\/"}]}},"jetpack_featured_media_url":"","_links":{"self":[{"href":"http:\/\/shabeebk.com\/blog\/wp-json\/wp\/v2\/posts\/171"}],"collection":[{"href":"http:\/\/shabeebk.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/shabeebk.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/shabeebk.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/shabeebk.com\/blog\/wp-json\/wp\/v2\/comments?post=171"}],"version-history":[{"count":11,"href":"http:\/\/shabeebk.com\/blog\/wp-json\/wp\/v2\/posts\/171\/revisions"}],"predecessor-version":[{"id":212,"href":"http:\/\/shabeebk.com\/blog\/wp-json\/wp\/v2\/posts\/171\/revisions\/212"}],"wp:attachment":[{"href":"http:\/\/shabeebk.com\/blog\/wp-json\/wp\/v2\/media?parent=171"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/shabeebk.com\/blog\/wp-json\/wp\/v2\/categories?post=171"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/shabeebk.com\/blog\/wp-json\/wp\/v2\/tags?post=171"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}