Devils666 Posted April 18, 2010 Report Share Posted April 18, 2010 if(!preg_match('/^[-0-9A-Z_\.]{5,18}$/i', $masiivs)) { $error = 'Kluda!'; } Kā šim preg_match'am varētu peivienot vēl simbolus . un -? Quote Link to comment Share on other sites More sharing options...
briedis Posted April 18, 2010 Report Share Posted April 18, 2010 if(!preg_match('/^[-0-9A-Z_\.]{5,18}$/i', $masiivs)) { $error = 'Kluda!'; } Kā šim preg_match'am varētu peivienot vēl simbolus . un -? eskeipojot \? un \. Quote Link to comment Share on other sites More sharing options...
emsy Posted April 18, 2010 Report Share Posted April 18, 2010 (edited) eskeipojot \? un \. Man liekas, ka ? bija tapēc, ka tās ir teikuma beigas :) Tbš, vajag \- un \. :) Edited April 18, 2010 by emsy Quote Link to comment Share on other sites More sharing options...
Devils666 Posted April 18, 2010 Author Report Share Posted April 18, 2010 jā, es nebiju pamanijis, ka ar \- var peiveinot simbolus beidzot ar preg_match viss skaidrs :) Quote Link to comment Share on other sites More sharing options...
briedis Posted April 18, 2010 Report Share Posted April 18, 2010 jā, es nebiju pamanijis, ka ar \- var peiveinot simbolus beidzot ar preg_match viss skaidrs :) Parādi, kas tad tur galā sanācis. Quote Link to comment Share on other sites More sharing options...
marcis Posted April 18, 2010 Report Share Posted April 18, 2010 Vispār jau pirmajā postā redzamais regex atļauj "-" un "." Quote Link to comment Share on other sites More sharing options...
Kemito Posted April 18, 2010 Report Share Posted April 18, 2010 Lūdzams galaiznākumu priekš citiem :) 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.