fix: Fix the email validation problem for a.b@c.club.

pull/94/head
yyzhang 3 years ago
parent f8eefa31fe
commit 087bc27368

@ -21,7 +21,7 @@ class TimestampField(fields.Raw):
def email(email): def email(email):
# Define a regex pattern for email addresses # Define a regex pattern for email addresses
pattern = r"^[a-zA-Z0-9_.+-]+@[a-zA-Z0-9-]+\.[a-zA-Z0-9-.]+$" pattern = r"^[\w-.]+@([\w-]+.)+[\w-]{2,4}$"
# Check if the email matches the pattern # Check if the email matches the pattern
if re.match(pattern, email) is not None: if re.match(pattern, email) is not None:
return email return email

@ -7,7 +7,7 @@ import { useRouter } from 'next/navigation'
import Toast from '../components/base/toast' import Toast from '../components/base/toast'
import { setup } from '@/service/common' import { setup } from '@/service/common'
const validEmailReg = /^([a-zA-Z0-9_-])+@([a-zA-Z0-9_-])+(\.[a-zA-Z0-9_-])+/ const validEmailReg = /^[\w-.]+@([\w-]+.)+[\w-]{2,4}$/
const validPassword = /^(?=.*[a-zA-Z])(?=.*\d).{8,}$/ const validPassword = /^(?=.*[a-zA-Z])(?=.*\d).{8,}$/
const InstallForm = () => { const InstallForm = () => {

@ -13,7 +13,7 @@ import Button from '@/app/components/base/button'
import { login, oauth } from '@/service/common' import { login, oauth } from '@/service/common'
import { apiPrefix } from '@/config' import { apiPrefix } from '@/config'
const validEmailReg = /^([a-zA-Z0-9_-])+@([a-zA-Z0-9_-])+(\.[a-zA-Z0-9_-])+/ const validEmailReg = /^[\w-.]+@([\w-]+.)+[\w-]{2,4}$/
type IState = { type IState = {
formValid: boolean formValid: boolean

@ -80,7 +80,7 @@ export const DEFAULT_VALUE_MAX_LEN = 48
export const zhRegex = /^[\u4e00-\u9fa5]$/gm export const zhRegex = /^[\u4e00-\u9fa5]$/gm
export const emojiRegex = /^[\uD800-\uDBFF][\uDC00-\uDFFF]$/gm export const emojiRegex = /^[\uD800-\uDBFF][\uDC00-\uDFFF]$/gm
export const emailRegex = /^(([^<>()[\]\\.,;:\s@\"]+(\.[^<>()[\]\\.,;:\s@\"]+)*)|(\".+\"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/ export const emailRegex = /^[\w-.]+@([\w-]+.)+[\w-]{2,4}$/gm
const MAX_ZN_VAR_NAME_LENGHT = 8 const MAX_ZN_VAR_NAME_LENGHT = 8
const MAX_EN_VAR_VALUE_LENGHT = 16 const MAX_EN_VAR_VALUE_LENGHT = 16
export const getMaxVarNameLength = (value: string) => { export const getMaxVarNameLength = (value: string) => {

Loading…
Cancel
Save