markss84 Posted March 26, 2009 Report 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
v3rb0 Posted March 26, 2009 Report 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
markss84 Posted March 26, 2009 Author Report 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
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.