• + 1 comment
    $Regex_Pattern = '/^tac((tac)+\2|tac(tic))*$/';
    
    • + 0 comments

      A better pattern by @roshankumar350:

      $Regex_Pattern = '/^(\2tic|(tac))+$/';