3v4l.org

run code in 300+ PHP versions simultaneously
<?php $string = "a.a.a b.b..b c....c....c d...d..d e.e"; echo preg_match('~(?<=^|\s)([a-z])(?:\.\1?){5,6}\1(?=$|\s)~', $string, $match) ? $match[0] : 'no match';

preferences:
34.4 ms | 404 KiB | 5 Q