try this $password = 'abcdef'; if (preg_match ('/\w\d\w/', $password)) { die ("You must have a number between 2 letters in your password ... 0-9"); } -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php