aika Posted October 26, 2009 Report Share Posted October 26, 2009 lietoju sekojošu pārbaudi lietotājvārdam: preg_match('/^[a-zA-Z0-9][\w]+[a-zA-Z0-9]$/' ... savajadzējās atļaut arī '.', saguglēju sekojošu sintaksi: preg_match('/^[a-zA-Z0-9\.][\w]+[a-zA-Z0-9\.]$/' ... taču '.' tik un tā netiek akceptēts! what's wrong? Quote Link to comment Share on other sites More sharing options...
aika Posted October 26, 2009 Author Report Share Posted October 26, 2009 ā, un laikam + zonā to punktu nevajag minēt, citādi tas kļūs par obligātu nosacījumu Quote Link to comment Share on other sites More sharing options...
briedis Posted October 26, 2009 Report Share Posted October 26, 2009 (edited) Iesaku tādu progu - RegexBuddy (var nozagt torrentos) Uzreiz "paskaidro" regexpu un var arī testēt, debuggot utt. Par tavu regexpu saka šitā: (testējot punktu var ievadīt, bet tikai kā pēdējo simbolu) Nez, vispār tas tavs regexp tāds jocīgs... Tev nepietiktu ar ^[a-zA-Z0-9\.]{2,20}$ ? vienīgi tas neizslēdz variantu, ka niks ir "..........." Edited October 26, 2009 by briedis Quote Link to comment Share on other sites More sharing options...
aika Posted October 26, 2009 Author Report Share Posted October 26, 2009 Paldies per badiju! Man tas regexps no piemēriem kā validēt usernāmi! Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.