briedis Posted July 8, 2008 Report Share Posted July 8, 2008 Kāds varētu uzrakstīt, lūdzu, patternu priekš formas validācijas? Pieļaujamie simboli - Latviešu burti? Cik saprotu, [a-z] or ēūīāšģķļžčņ, bet sintaksē nespēju iebraukt... $pattern = "<([a-z]|ēūīāšģķļžčņ)*>"; $vards = "Mārtiņš"; if(eregi($pattern,$vards)) echo "Atbilst"; else echo "Neatbilst"; Kaut kas tamlīdzīgs? :) Link to comment Share on other sites More sharing options...
bubu Posted July 8, 2008 Report Share Posted July 8, 2008 [a-zēūīāšģķļžčņ] Link to comment Share on other sites More sharing options...
briedis Posted July 8, 2008 Author Report Share Posted July 8, 2008 (edited) Karoč šitā, ne? $pattern = "^[a-zēūīāšģķļžčņ]*$"; ...bet kā piešķirt maksimālo, minimālo vārda garumu? Kaut kā varēja tur ar iekavām {}, bet kas kur jāraksta? Piem, minimālais 3 simb, max 20. {3,20} ? hmmm Edited July 8, 2008 by briedis Link to comment Share on other sites More sharing options...
andrisp Posted July 8, 2008 Report Share Posted July 8, 2008 Tak pamēģini pats! Link to comment Share on other sites More sharing options...
Aleksejs Posted July 8, 2008 Report Share Posted July 8, 2008 http://lv.php.net/manual/en/regexp.reference.php Link to comment Share on other sites More sharing options...
cucumber Posted July 8, 2008 Report Share Posted July 8, 2008 $pattern = "^[a-zēūīāšģķļžčņ]{3,20}$"; Link to comment Share on other sites More sharing options...
briedis Posted July 9, 2008 Author Report Share Posted July 9, 2008 Paldies :) Link to comment Share on other sites More sharing options...
Toms Posted July 9, 2008 Report Share Posted July 9, 2008 http://www.rexv.org/ Link to comment Share on other sites More sharing options...
Recommended Posts