Basic php regex to find repeated character not working..
$subject = 'rrrr';
var_dump(preg_match("/([a-zA-Z])\1{2,}$/i", $subject));
var_dump(preg_match("/(\w)\1{2,}$/i", $subject));
same seem to be working here : https://regex101.com/r/OCAwi0/2
Basic php regex to find repeated character not working..
$subject = 'rrrr';
var_dump(preg_match("/([a-zA-Z])\1{2,}$/i", $subject));
var_dump(preg_match("/(\w)\1{2,}$/i", $subject));
same seem to be working here : https://regex101.com/r/OCAwi0/2
Try this code, example in link : https://3v4l.org/9MFvm
<?php
$regex = '#([a-zA-z ])\1{2,}$#';
$string = 'rrrr';
preg_match($regex, $string, $matches);
var_dump($matches);