<?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';
You have javascript disabled. You will not be able to edit any code.