3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $string = '中文'; preg_match('/^[\pL\pM\pN_-]+$/u', $string, $matches1); preg_match('/^[a-z0-9_-]+$/u', $string, $matches2); var_dump($matches1); var_dump($matches2);
based on Kp2IY
Output for 4.4.3 - 4.4.9, 5.1.3 - 7.2.0
array(1) { [0]=> string(6) "中文" } array(0) { }
Output for 4.4.0 - 4.4.2, 5.0.5 - 5.1.2
array(0) { } array(0) { }
Output for 4.3.11, 5.0.0 - 5.0.4
Warning: preg_match(): Compilation failed: PCRE does not support \L, \l, \N, \P, \p, \U, \u, or \X at offset 3 in /in/bUGlb on line 5 array(0) { } array(0) { }
Output for 4.3.0 - 4.3.10
Warning: Compilation failed: PCRE does not support \L, \l, \N, \P, \p, \U, \u, or \X at offset 3 in /in/bUGlb on line 5 array(0) { } array(0) { }