<title>PHP Regular Expression</title>
$pattern_01 = "/^[[:digit:]]{2}\-[[:digit:]]{4}\-[[:digit:]]{4}/";
if (preg_match($pattern_01, $tel, $matches_01)) {
echo "{$tel}은 유효한 형식의 전화번호가 아닙니다.<br>";
if (preg_match($pattern_01, $cell, $matches_02)) {
echo "{$cell}은 유효한 형식의 전화번호가 아닙니다.<br>";
$pattern_02 = "/^[[:digit:]]{2,3}\-[[:digit:]]{3,4}\-[[:digit:]]{4}/";
if (preg_match($pattern_02, $tel, $matches_03)) {
echo "{$tel}은 유효한 형식의 전화번호가 아닙니다.<br>";
if (preg_match($pattern_02, $cell, $matches_04)) {
echo "{$cell}은 유효한 형식의 전화번호가 아닙니다.<br>";