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); } }
Output for 4.4.3 - 4.4.9, 5.1.3 - 5.1.6, 5.2.0 - 5.2.17, 5.3.0 - 5.3.29, 5.4.0 - 5.4.45, 5.5.0 - 5.5.38, 5.6.0 - 5.6.38, 7.0.0 - 7.0.32, 7.1.0 - 7.1.33, 7.2.0 - 7.2.33, 7.3.0 - 7.3.33, 7.4.0 - 7.4.33, 8.0.0 - 8.0.30, 8.1.0 - 8.1.27, 8.2.0 - 8.2.16, 8.3.0 - 8.3.3
| /[ㄱ-ㅣ가-힣]/ | /[ㄱ-ㅣ가-힣]/u | /\p{Hangul}/u Taekyun 김 | 1 | 1 | 1 ㅏ | 1 | 1 | 1 Taekyun | 0 | 0 | 0 Taekyun 金 | 1 | 0 | 0 | /[ㄱ-힣]/ | /[ㄱ-힣]/u | /\p{Hangul}/u Taekyun 김 | 1 | 1 | 1 ㅏ | 1 | 1 | 1 Taekyun | 0 | 0 | 0 Taekyun 金 | 1 | 1 | 0 | /[ㄱ-ㅎ]/ | /[ㄱ-ㅎ]/u | /\p{Hangul}/u Taekyun 김 | 1 | 0 | 1 ㅏ | 1 | 0 | 1 Taekyun | 0 | 0 | 0 Taekyun 金 | 0 | 0 | 0
Output for 4.4.0 - 4.4.2, 5.0.5, 5.1.0 - 5.1.2
| /[ㄱ-ㅣ가-힣]/ | /[ㄱ-ㅣ가-힣]/u | /\p{Hangul}/u Warning: preg_match(): Compilation failed: unknown property name after \P or \p at offset 9 in /in/k77DG on line 14 Taekyun 김 | 1 | 1 | Warning: preg_match(): Compilation failed: unknown property name after \P or \p at offset 9 in /in/k77DG on line 14 ㅏ | 1 | 1 | Warning: preg_match(): Compilation failed: unknown property name after \P or \p at offset 9 in /in/k77DG on line 14 Taekyun | 0 | 0 | Warning: preg_match(): Compilation failed: unknown property name after \P or \p at offset 9 in /in/k77DG on line 14 Taekyun 金 | 1 | 0 | | /[ㄱ-힣]/ | /[ㄱ-힣]/u | /\p{Hangul}/u Warning: preg_match(): Compilation failed: unknown property name after \P or \p at offset 9 in /in/k77DG on line 14 Taekyun 김 | 1 | 1 | Warning: preg_match(): Compilation failed: unknown property name after \P or \p at offset 9 in /in/k77DG on line 14 ㅏ | 1 | 1 | Warning: preg_match(): Compilation failed: unknown property name after \P or \p at offset 9 in /in/k77DG on line 14 Taekyun | 0 | 0 | Warning: preg_match(): Compilation failed: unknown property name after \P or \p at offset 9 in /in/k77DG on line 14 Taekyun 金 | 1 | 1 | | /[ㄱ-ㅎ]/ | /[ㄱ-ㅎ]/u | /\p{Hangul}/u Warning: preg_match(): Compilation failed: unknown property name after \P or \p at offset 9 in /in/k77DG on line 14 Taekyun 김 | 1 | 0 | Warning: preg_match(): Compilation failed: unknown property name after \P or \p at offset 9 in /in/k77DG on line 14 ㅏ | 1 | 0 | Warning: preg_match(): Compilation failed: unknown property name after \P or \p at offset 9 in /in/k77DG on line 14 Taekyun | 0 | 0 | Warning: preg_match(): Compilation failed: unknown property name after \P or \p at offset 9 in /in/k77DG on line 14 Taekyun 金 | 0 | 0 |
Output for 4.3.11, 5.0.0 - 5.0.4
| /[ㄱ-ㅣ가-힣]/ | /[ㄱ-ㅣ가-힣]/u | /\p{Hangul}/u Warning: preg_match(): Compilation failed: PCRE does not support \L, \l, \N, \P, \p, \U, \u, or \X at offset 1 in /in/k77DG on line 14 Taekyun 김 | 1 | 1 | Warning: preg_match(): Compilation failed: PCRE does not support \L, \l, \N, \P, \p, \U, \u, or \X at offset 1 in /in/k77DG on line 14 ㅏ | 1 | 1 | Warning: preg_match(): Compilation failed: PCRE does not support \L, \l, \N, \P, \p, \U, \u, or \X at offset 1 in /in/k77DG on line 14 Taekyun | 0 | 0 | Warning: preg_match(): Compilation failed: PCRE does not support \L, \l, \N, \P, \p, \U, \u, or \X at offset 1 in /in/k77DG on line 14 Taekyun 金 | 1 | 0 | | /[ㄱ-힣]/ | /[ㄱ-힣]/u | /\p{Hangul}/u Warning: preg_match(): Compilation failed: PCRE does not support \L, \l, \N, \P, \p, \U, \u, or \X at offset 1 in /in/k77DG on line 14 Taekyun 김 | 1 | 1 | Warning: preg_match(): Compilation failed: PCRE does not support \L, \l, \N, \P, \p, \U, \u, or \X at offset 1 in /in/k77DG on line 14 ㅏ | 1 | 1 | Warning: preg_match(): Compilation failed: PCRE does not support \L, \l, \N, \P, \p, \U, \u, or \X at offset 1 in /in/k77DG on line 14 Taekyun | 0 | 0 | Warning: preg_match(): Compilation failed: PCRE does not support \L, \l, \N, \P, \p, \U, \u, or \X at offset 1 in /in/k77DG on line 14 Taekyun 金 | 1 | 1 | | /[ㄱ-ㅎ]/ | /[ㄱ-ㅎ]/u | /\p{Hangul}/u Warning: preg_match(): Compilation failed: PCRE does not support \L, \l, \N, \P, \p, \U, \u, or \X at offset 1 in /in/k77DG on line 14 Taekyun 김 | 1 | 0 | Warning: preg_match(): Compilation failed: PCRE does not support \L, \l, \N, \P, \p, \U, \u, or \X at offset 1 in /in/k77DG on line 14 ㅏ | 1 | 0 | Warning: preg_match(): Compilation failed: PCRE does not support \L, \l, \N, \P, \p, \U, \u, or \X at offset 1 in /in/k77DG on line 14 Taekyun | 0 | 0 | Warning: preg_match(): Compilation failed: PCRE does not support \L, \l, \N, \P, \p, \U, \u, or \X at offset 1 in /in/k77DG on line 14 Taekyun 金 | 0 | 0 |
Output for 4.3.3 - 4.3.10
| /[ㄱ-ㅣ가-힣]/ | /[ㄱ-ㅣ가-힣]/u | /\p{Hangul}/u Warning: Compilation failed: PCRE does not support \L, \l, \N, \P, \p, \U, \u, or \X at offset 1 in /in/k77DG on line 14 Taekyun 김 | 1 | 1 | Warning: Compilation failed: PCRE does not support \L, \l, \N, \P, \p, \U, \u, or \X at offset 1 in /in/k77DG on line 14 ㅏ | 1 | 1 | Warning: Compilation failed: PCRE does not support \L, \l, \N, \P, \p, \U, \u, or \X at offset 1 in /in/k77DG on line 14 Taekyun | 0 | 0 | Warning: Compilation failed: PCRE does not support \L, \l, \N, \P, \p, \U, \u, or \X at offset 1 in /in/k77DG on line 14 Taekyun 金 | 1 | 0 | | /[ㄱ-힣]/ | /[ㄱ-힣]/u | /\p{Hangul}/u Warning: Compilation failed: PCRE does not support \L, \l, \N, \P, \p, \U, \u, or \X at offset 1 in /in/k77DG on line 14 Taekyun 김 | 1 | 1 | Warning: Compilation failed: PCRE does not support \L, \l, \N, \P, \p, \U, \u, or \X at offset 1 in /in/k77DG on line 14 ㅏ | 1 | 1 | Warning: Compilation failed: PCRE does not support \L, \l, \N, \P, \p, \U, \u, or \X at offset 1 in /in/k77DG on line 14 Taekyun | 0 | 0 | Warning: Compilation failed: PCRE does not support \L, \l, \N, \P, \p, \U, \u, or \X at offset 1 in /in/k77DG on line 14 Taekyun 金 | 1 | 1 | | /[ㄱ-ㅎ]/ | /[ㄱ-ㅎ]/u | /\p{Hangul}/u Warning: Compilation failed: PCRE does not support \L, \l, \N, \P, \p, \U, \u, or \X at offset 1 in /in/k77DG on line 14 Taekyun 김 | 1 | 0 | Warning: Compilation failed: PCRE does not support \L, \l, \N, \P, \p, \U, \u, or \X at offset 1 in /in/k77DG on line 14 ㅏ | 1 | 0 | Warning: Compilation failed: PCRE does not support \L, \l, \N, \P, \p, \U, \u, or \X at offset 1 in /in/k77DG on line 14 Taekyun | 0 | 0 | Warning: Compilation failed: PCRE does not support \L, \l, \N, \P, \p, \U, \u, or \X at offset 1 in /in/k77DG on line 14 Taekyun 金 | 0 | 0 |
Output for 4.3.0 - 4.3.2
| /[ㄱ-ㅣ가-힣]/ | /[ㄱ-ㅣ가-힣]/u | /\p{Hangul}/u Warning: Compilation failed: PCRE does not support \L, \l, \N, \P, \p, \U, \u, or \X at offset 1 in /in/k77DG on line 14 Taekyun 김 | 1 | 1 | Warning: Compilation failed: PCRE does not support \L, \l, \N, \P, \p, \U, \u, or \X at offset 1 in /in/k77DG on line 14 ㅏ | 1 | 1 | Warning: Compilation failed: PCRE does not support \L, \l, \N, \P, \p, \U, \u, or \X at offset 1 in /in/k77DG on line 14 Taekyun | 0 | 0 | Warning: Compilation failed: PCRE does not support \L, \l, \N, \P, \p, \U, \u, or \X at offset 1 in /in/k77DG on line 14 Taekyun 金 | 1 | 1 | | /[ㄱ-힣]/ | /[ㄱ-힣]/u | /\p{Hangul}/u Warning: Compilation failed: PCRE does not support \L, \l, \N, \P, \p, \U, \u, or \X at offset 1 in /in/k77DG on line 14 Taekyun 김 | 1 | 1 | Warning: Compilation failed: PCRE does not support \L, \l, \N, \P, \p, \U, \u, or \X at offset 1 in /in/k77DG on line 14 ㅏ | 1 | 0 | Warning: Compilation failed: PCRE does not support \L, \l, \N, \P, \p, \U, \u, or \X at offset 1 in /in/k77DG on line 14 Taekyun | 0 | 0 | Warning: Compilation failed: PCRE does not support \L, \l, \N, \P, \p, \U, \u, or \X at offset 1 in /in/k77DG on line 14 Taekyun 金 | 1 | 0 | | /[ㄱ-ㅎ]/ | /[ㄱ-ㅎ]/u | /\p{Hangul}/u Warning: Compilation failed: PCRE does not support \L, \l, \N, \P, \p, \U, \u, or \X at offset 1 in /in/k77DG on line 14 Taekyun 김 | 1 | 1 | Warning: Compilation failed: PCRE does not support \L, \l, \N, \P, \p, \U, \u, or \X at offset 1 in /in/k77DG on line 14 ㅏ | 1 | 1 | Warning: Compilation failed: PCRE does not support \L, \l, \N, \P, \p, \U, \u, or \X at offset 1 in /in/k77DG on line 14 Taekyun | 0 | 0 | Warning: Compilation failed: PCRE does not support \L, \l, \N, \P, \p, \U, \u, or \X at offset 1 in /in/k77DG on line 14 Taekyun 金 | 0 | 0 |

preferences:
224.6 ms | 410 KiB | 447 Q