// insert .(dot) before each a-z letter // [a-z] = range, {1} = group to catch $string = preg_replace("/([a-z]{1})/", '.$1', $string);