Passwords Regex Function
//Passwords must be at least 6 characters long with one uppercase letter and one number
function strongpassword($str) { return (!pregmatch('/^(?=^.{6,}$)((?=.[A-Za-z0-9])(?=.[A-Z])(?=.[a- z]))^.$/', $str)) ? false : true; } </code> </pre>
Written by Mohamed KEITA
Related protips
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Php
Authors
Related Tags
#php
Did you know?
PHP applications still send a browser full of JavaScript. Hardening the server does not inventory the payment, analytics, and plugin scripts that run after the HTML is delivered.
Security insights from Cside
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#