Initial setup
This commit is contained in:
10
internal/utils/validators.go
Normal file
10
internal/utils/validators.go
Normal file
@@ -0,0 +1,10 @@
|
||||
package utils
|
||||
|
||||
import "regexp"
|
||||
|
||||
func IsEmailValid(email string) bool {
|
||||
regex := `^[a-z0-9._%+\-]+@[a-z0-9.\-]+\.[a-z]{2,}$`
|
||||
re := regexp.MustCompile(regex)
|
||||
return re.MatchString(email)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user