Skip to content

Commit

Permalink
Changed regular expression for checking validity of number and passwo…
Browse files Browse the repository at this point in the history
…rd (#403)
  • Loading branch information
fkma13552 authored Oct 15, 2021
1 parent bd99705 commit 430b1a3
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ public class RegisterViewModel

[Required(ErrorMessage = "Password is required")]
[RegularExpression(
@"^(?=.*[a-z])(?=.*[A-Z])(?=.*\d)(?=.*[@$!%*?&])[A-Za-z\d@$!%*?&]{8,}$",
@"^(?=.*[a-z])(?=.*[A-Z])(?=.*\d)(?=.*[@$!%*?&])[A-Za-z\d@$!%*?&]{6,}$",
ErrorMessage = "Password must contain at least one capital, number and symbol(@$!%*?&).")]
[DataType(DataType.Password)]
public string Password { get; set; }
Expand All @@ -32,8 +32,8 @@ public class RegisterViewModel
[DataType(DataType.PhoneNumber)]
[Required(ErrorMessage = "Phone number is required")]
[RegularExpression(
@"([0-9]{3})([-]?)([0-9]{3})([-]?)([0-9]{2})([-]?)([0-9]{2})",
ErrorMessage = "Phone number format is incorrect. Example: +38XXX-XXX-XX-XX")]
@"([0-9]{2})([-]?)([0-9]{3})([-]?)([0-9]{2})([-]?)([0-9]{2})",
ErrorMessage = "Phone number format is incorrect. Example: +380XX-XXX-XX-XX")]
public string PhoneNumber { get; set; }

[DataType(DataType.DateTime)]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,8 +84,8 @@
@SharedLocalizer["Phone"]<span class="registration_star">*</span>
</label>
<div class="registration_phone">
<div class="registration_phone-code">+38</div>
<input class="registration_input" maxlength="10" type="text" asp-for="PhoneNumber" id="phone_number">
<div class="registration_phone-code">+380</div>
<input class="registration_input" maxlength="9" type="text" asp-for="PhoneNumber" id="phone_number">
</div>
<div>
<span asp-validation-for="PhoneNumber"></span>
Expand Down

0 comments on commit 430b1a3

Please sign in to comment.