27 $template = static::$templates[mb_strlen($rawNumber)];
33 $pattern = preg_replace(
"/[^x]/",
"", $template);
34 $pattern = str_replace(
"x",
"(\\d)", $pattern);
35 $pattern =
"/" . $pattern .
"/";
37 $format = preg_replace_callback(
46 $result = preg_replace($pattern, $format, $rawNumber);