This commit is contained in:
makeyangcom
2024-03-16 16:00:57 +08:00
parent 865ea763c1
commit 1b1f3fac22
5 changed files with 85 additions and 3 deletions

View File

@@ -542,4 +542,18 @@ account := router.Group("account")
{
account.POST("/register", AccountInterface.Register)
}
```
### 邮箱格式验证函数
> 用于游戏引擎中验证邮箱格式的合法性
``` go
func check_mail_format(mail:String) -> bool:
var check:bool = true
var regex = RegEx.new()
regex.compile("^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\\.[a-zA-Z]{2,6}$")
if !regex.search(mail):
check = false
return check
```