wudu Posted December 1, 2005 Report Share Posted December 1, 2005 sveiki. kaads buutu labaakais (aatraakais, skaistaakais, mazaak kodu aiznjemosh) variants lai noteiktu vai texta stringaa sastopama kaada noteikta simbolu grupa (lielie burti, mazie, burti, cipari). piem. f-ja vai_ir_textaa('011101X01',LIELIE_BURTI) atgrieztu true, bet vai_ir_textaa('ahj&GG',CIPARI) agrieztu false. p.s. izmantojot javascriptu Link to comment Share on other sites More sharing options...
Paulinjsh Posted December 1, 2005 Report Share Posted December 1, 2005 Apskaties par RegExp. Tur varētu sev šo to noderīgu atrast. Link to comment Share on other sites More sharing options...
wudu Posted December 1, 2005 Author Report Share Posted December 1, 2005 paldies, probleema atrisinaata =] function contains_num(text){ if (text.match(/\d+/) != null) { return true; } else { return false; } } function contains_upp(text){ if (text.match("[A-Z]") != null) { return true; } else { return false; } } function contains_low(text){ if (text.match("[a-z]") != null) { return true; } else { return false; } } Link to comment Share on other sites More sharing options...
Recommended Posts