Txheeb xyuas Lo Lus zais Lub Zog nrog Javascript thiab Qhia Cov Lus

Kuv tau ua qee qhov kev tshawb fawb txog kev nrhiav qhov piv txwv ntawm Kev Tshuaj Xyuas Tus Zog Password uas siv JavaScript thiab Kev Qhia Ua Tau Zoo (Regex). Hauv daim ntawv thov ntawm kuv kev ua haujlwm, peb ua tus xa rov qab mus xyuas qhov password muaj zog thiab nws yooj yim heev rau peb cov neeg siv. Regex yog dab tsi? Kev qhia tsis tu ncua yog kab xwm ntawm cov cim uas txhais lub qauv tshawb. Feem ntau, cov qauv zoo li no yog siv los ntawm txoj kev tshawb nrhiav cov txheej txheem nrhiav rau lossis nrhiav thiab

Txheeb xyuas Chaw Sau Ntawv Email nrog JavaScript thiab Kab Lus Qhia Uas Niaj Hnub

Ib lub sijhawm dhau los Kuv tau teeb tsa Tus Zov Me Nyuam Qhov Password uas siv ntu JavaScript thiab Kab Lus Qhia Sawv Cev. Ntawm tib daim ntawv ntawd, koj tuaj yeem tshawb xyuas tus qauv ntawm tus email chaw nyob uas yog siv kev qhia tawm ib txwm siv (regex) kev teeb tsa. Yog tias koj daim ntawv foos muaj daim id = "emailaddress" thiab koj ntxiv ib daim onSubmit = "rov qab checkEmail ();", qhov no yog Javascript muaj nuj nqi uas koj tuaj yeem siv rov qab ceeb toom yog tias email chaw nyob muaj tus qauv siv tau lossis tsis:

Siv Tau Email Chaw Nyob Ntev

Kuv yuav tsum tau ua qee qhov kev khawb hnub no kom pom nws, tab sis koj puas paub qhov ntev ntawm qhov chaw nyob email yog dab tsi? Nws tau tawg mus rau qhov chaw… Name@Domain.com. Qhov no yog raws li RFC2822. Lub npe tuaj yeem yog 1 txog 64 cim. Sau tau yuav 1 txog 255 cim. Wow ... hais tias txhais tau hais tias qhov no yuav yog ib tug siv tau email chaw nyob: loremaipsumadolorasitaametbaconsectetueraadipiscin gaelitanullamc @ loremaipsumadolorasitaametbaconsect etueraadipiscingaelitcaSedaidametusautanisiavehicu laaluctuscaPellentesqueatinciduntbadiamaidacondimn tumarutrumbaturpisamassaaconsectetueraarcubaeuatin ciduntaliberoaaugueavestibulumaeratcaPhasellusatin ciduntaturpisaduis.com Sim haum uas nyob rau ib lub lag luam card! Ironically, feem ntau