I'm writing a password strength checker in PHP, and I'm using Regular Expressions to calculate various parameters for the strength calculation. I need to be able to check the number of repeating consecutive characters in a string. For example:
baaabaaablacksheep
would return 5
sillystring
would return 1
and so on...