3v4l.org

run code in 300+ PHP versions simultaneously
<?php // 정규표현식 패턴별 호출 setRegx('/[ㄱ-ㅣ가-힣]/', '/[ㄱ-ㅣ가-힣]/u'); setRegx('/[ㄱ-힣]/', '/[ㄱ-힣]/u'); setRegx('/[ㄱ-ㅎ]/', '/[ㄱ-ㅎ]/u'); // 결과 출력 function setRegx($sRegx1, $sRegx2) { $aString = array('Taekyun 김', 'ㅏ', 'Taekyun', 'Taekyun 金'); echo chr(10).str_pad('', 10).' | '.str_pad($sRegx1, 11).' | '.str_pad($sRegx2, 11).' | '.str_pad('/\p{Hangul}/u', 11).chr(10); foreach ($aString as $sText) { echo str_pad($sText, 10).' | '.str_pad(preg_match($sRegx1, $sText), 11).' | '.str_pad(preg_match($sRegx2, $sText), 11).' | '.str_pad(preg_match('/\p{Hangul}/u', $sText), 11).chr(10); } }

preferences:
47.7 ms | 402 KiB | 5 Q