I'm using a passwordpolicy library from this site written in PHP http://craig-russell.co.uk/password-policy/index.html
It uses perl regex for most of its rules.
I have been trying to add a new rule to make it not accept 3 repeated characters.
I've tried severals regex that has been posted and asked about here and this is the one I've recently tried out
[\w((.)\1{3,}]
But it just don't seem to work
It matches aaaa but if you write aaab it still matches it. Seems like it trying to match the string as a whole
This is the array where the regex goes:
$this->rules['max_allowedsame_chars'] = array(
'value' => false,
'type' => 'integer',
'test' => 'return preg_match_all("/[\w ((.)\1{3,})/",$p,$x)<=$v;',
'error' => 'Password cant contain no more than #VALUE# of the same characters');
Any tips would be appreciated.