Regex: How to prevent password to contain 3 consecutive characters as a substring



Puzzle: What regular expression in php would check that the password does not contain 3 consecutive characters as a substring?

Example Code:

<?php
if(preg_match('/(.)\1\1/'$pass)){
form_error($formt('Passwords cannot contain sequences of 3 or more of the same character.'));
}
?>



As specified at: http://nl3.php.net/manual/en/regexp.reference.back-references.php