markss84 Posted March 26, 2009 Report Share Posted March 26, 2009 Kā var pārbaudīt pārbaudīt username vai password-vai tā sastāv tikai no cipariem un burtiem un būtu noteikta garuma - piem 8-12 simboli? Mēģinaju šādi eregi("([a-z0-9])", $x), bet tas laikam nav īsti pareizi. Quote Link to comment Share on other sites More sharing options...
v3rb0 Posted March 26, 2009 Report Share Posted March 26, 2009 (edited) /[a-z0-9]{8,12}/i un eregi() vietā izmanto preg_match(), jo http://www.regular-expressions.info/php.html Edited March 26, 2009 by v3rb0 Quote Link to comment Share on other sites More sharing options...
markss84 Posted March 26, 2009 Author Report Share Posted March 26, 2009 Jā, bet teiksim, kad rakstu preg_match("/[a-z0-9]{2,12}/i","!aaaa!") - arī tiek uzskatīts par pareizu, kaut gan tā neder. Quote Link to comment Share on other sites More sharing options...
bubu Posted March 26, 2009 Report Share Posted March 26, 2009 Raksi šitā: /^[a-z0-9]{8,12}$/i 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.