generated from GSM-MSG/MSG-Repository-Generator
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #263 from School-of-Company/refactor/262-refactor-…
…email-module 🔀 :: (#262) - refactor email module
- Loading branch information
Showing
6 changed files
with
188 additions
and
177 deletions.
There are no files selected for viewing
10 changes: 2 additions & 8 deletions
10
core/design-system/src/main/java/com/msg/design_system/util/checkRegex.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,5 @@ | ||
package com.msg.design_system.util | ||
|
||
fun String.checkEmailRegex(): Boolean { | ||
val emailRegex = "^[A-Za-z0-9+_.-]+@[A-Za-z0-9.-]+\$" | ||
return this.matches(emailRegex.toRegex()) | ||
} | ||
fun String.checkEmailRegex(): Boolean = this.matches("^[A-Za-z0-9+_.-]+@[A-Za-z0-9.-]+\$".toRegex()) | ||
|
||
fun String.checkPasswordRegex(): Boolean { | ||
val passwordRegex = "^(?=.*[0-9])(?=.*[A-Za-z])(?=.*[@#$%^&+=!?.])(?=\\S+$).{8,24}.$" | ||
return this.matches(passwordRegex.toRegex()) | ||
} | ||
fun String.checkPasswordRegex(): Boolean = this.matches("^(?=.*[0-9])(?=.*[^A-Za-z0-9]).{8,}$".toRegex()) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.