function ui_lobby:checkisEmail(str) if string.len(str or "") < 6 then return false end local b,e = string.find(str or "", '@') local bstr = "" local estr = "" if b then bstr = string.sub(str, 1, b-1) estr = string.sub(str, e+1, -1) else return false end -- check the string before '@' local p1,p2 = string.find(bstr, "[%w]+") if (p1 ~= 1) or (p2 ~= string.len(bstr)) then return false end if string.find(estr, "^[%.]+") then return false end if string.find(estr, "%.[%.]+") then return false end if string.find(estr, "@") then return false end if string.find(estr, "[%.]+$") then return false end local w,count = string.gsub(estr, "%.", "") if (count < 1 ) or (count > 3) then return false end return true end
最新推荐文章于 2020-04-22 20:08:39 发布