{"id":80,"date":"2006-04-24T12:04:50","date_gmt":"2006-04-24T11:04:50","guid":{"rendered":"http:\/\/www.galhano.com\/blog\/?p=80"},"modified":"2008-02-07T18:24:24","modified_gmt":"2008-02-07T17:24:24","slug":"passwordregularexpression","status":"publish","type":"post","link":"http:\/\/galhano.com\/blog\/?p=80","title":{"rendered":"PasswordRegularExpression"},"content":{"rendered":"<p><span id=\"ctl00_LibFrame_MainContent\">CreateUserWizard.PasswordRegularExpression<\/span><br \/>\n<span id=\"ctl00_LibFrame_MainContent\"><span style=\"color: red\">Note:  This property is new in the .NET Framework version 2.0.<\/span><\/span><\/p>\n<p>Gets or sets a regular expression used to validate the provided password.<\/p>\n<p><strong>Namespace:<\/strong> System.Web.UI.WebControls<br \/>\n<strong>Assembly:<\/strong> System.Web (in system.web.dll)<\/p>\n<p><code>&lt;strong&gt;Visual Basic (Declaration)&lt;\/strong&gt;<br \/>\n&lt;span style=&quot;background-color: #dbdbdb&quot;&gt;Public Overridable Property  PasswordRegularExpression As String&lt;\/span&gt;<\/code><code> &lt;strong&gt;Visual Basic (Usage)&lt;\/strong&gt;<br \/>\n&lt;span style=&quot;background-color: #dbdbdb&quot;&gt;Dim instance As CreateUserWizard<br \/>\nDim value As String<br \/>\nvalue = instance.PasswordRegularExpression<br \/>\ninstance.PasswordRegularExpression = value&lt;\/span&gt;<\/code><\/p>\n<p><span id=\"ctl00_LibFrame_MainContent\"><strong><span class=\"CollapseRegionLink\">Remarks<\/span><\/strong><\/span><\/p>\n<div class=\"section\" id=\"ctl00_LibFrame_ctl22bdd87f4\" style=\"display: block\">\n<div id=\"ctl00_LibFrame_ctl22\">Use the <strong>PasswordRegularExpression<\/strong> property to define the requirements for passwords used to validate users on your Web site. A common use is to make sure that a user has included symbols other than letters in a password to make it harder for attackers to guess a password. The regular expression is used in addition to any restrictions placed on the password by the membership provider specified in the <a onclick=\"javascript:TrackThisClick('ctl00_LibFrame_ctl22','ctl00_LibFrame_ctl23',this);\" href=\"http:\/\/msdn2.microsoft.com\/en-us\/library\/system.web.ui.webcontrols.createuserwizard.membershipprovider.aspx\">MembershipProvider<\/a> property. If the membership provider rejects the password for any reason, the text contained in the <a onclick=\"javascript:TrackThisClick('ctl00_LibFrame_ctl22','ctl00_LibFrame_ctl24',this);\" href=\"http:\/\/msdn2.microsoft.com\/en-us\/library\/system.web.ui.webcontrols.createuserwizard.invalidpassworderrormessage.aspx\">InvalidPasswordErrorMessage<\/a> property is displayed.If the password entered does not pass the regular expression, the error message contained in the <a onclick=\"javascript:TrackThisClick('ctl00_LibFrame_ctl22','ctl00_LibFrame_ctl25',this);\" href=\"http:\/\/msdn2.microsoft.com\/en-us\/library\/system.web.ui.webcontrols.createuserwizard.passwordregularexpressionerrormessage.aspx\">PasswordRegularExpressionErrorMessage<\/a> property is displayed to the user.<\/div>\n<\/div>\n<table width=\"100%\" cellspacing=\"1\" border=\"0\" id=\"table1\">\n<tr>\n<td bgcolor=\"#dbdbdb\"><span id=\"ctl00_LibFrame_MainContent\"><span class=\"CollapseRegionLink\">Example<\/span><\/p>\n<div class=\"section\" id=\"ctl00_LibFrame_ctl277da5a7d\" style=\"display: block\">\n<div id=\"ctl00_LibFrame_ctl27\">The following code example uses the <strong>PasswordRegularExpression<\/strong> property to define a regular expression that checks passwords to ensure that they:<\/p>\n<ul>\n<li>Are longer than seven characters.<\/li>\n<li>Contain at least one digit.<\/li>\n<li>Contain at least one special (nonalphanumeric) character.<\/li>\n<\/ul>\n<p>If the password entered by the user does not meet these criteria, the text contained in the <strong>PasswordRegularExpressionErrorMessage<\/strong> property is displayed to the user.<\/div>\n<\/div>\n<p><\/span><\/td>\n<\/tr>\n<tr>\n<td bgcolor=\"#dbdbdb\"><span id=\"ctl00_LibFrame_MainContent\"><\/p>\n<pre class=\"code\" id=\"ctl00_LibFrame_ctl28VisualBasic\">passwordregularexpression=<span style=\"color: green\">'@\\\"(?=.{7,})(?=(.*d){1,})(?=(.*W){1,})'<\/span><\/pre>\n<p><\/span><\/td>\n<\/tr>\n<\/table>\n<p>LINKs<\/p>\n<hr \/>\n<p><a href=\"http:\/\/www.regular-expressions.info\/\">http:\/\/www.regular-expressions.info\/<\/a><a href=\"http:\/\/www.4guysfromrolla.com\/webtech\/120400-1.shtml\">http:\/\/www.4guysfromrolla.com\/webtech\/120400-1.shtml\u00c2 <\/a><!--a54e5242be3cf8a3b652cb67be1bb1dd--><\/p>\n","protected":false},"excerpt":{"rendered":"<p>CreateUserWizard.PasswordRegularExpression Note: This property is new in the .NET Framework version 2.0. Gets or sets a regular expression used to validate the provided password. Namespace: System.Web.UI.WebControls Assembly: System.Web (in system.web.dll) &lt;strong&gt;Visual Basic (Declaration)&lt;\/strong&gt; &lt;span style=&quot;background-color: #dbdbdb&quot;&gt;Public Overridable Property PasswordRegularExpression As String&lt;\/span&gt; &lt;strong&gt;Visual Basic (Usage)&lt;\/strong&gt; &lt;span style=&quot;background-color: #dbdbdb&quot;&gt;Dim instance As CreateUserWizard Dim value As String value [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"close","ping_status":"close","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[28],"tags":[],"class_list":["post-80","post","type-post","status-publish","format-standard","hentry","category-aspnet-20","author-admin"],"_links":{"self":[{"href":"http:\/\/galhano.com\/blog\/index.php?rest_route=\/wp\/v2\/posts\/80","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/galhano.com\/blog\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/galhano.com\/blog\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/galhano.com\/blog\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/galhano.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=80"}],"version-history":[{"count":0,"href":"http:\/\/galhano.com\/blog\/index.php?rest_route=\/wp\/v2\/posts\/80\/revisions"}],"wp:attachment":[{"href":"http:\/\/galhano.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=80"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/galhano.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=80"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/galhano.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=80"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}