2016-03-22 13 views

答えて

2

プレーンでシンプルな意味u修飾子とwは\使用します。これは次のようになりPHP

^[\d\p{L}\h]{3,25}$ 
# match the start (^), digits or any letter 
# and horizontal space three to 25 times 
# end of the string/line ($) 

を:

$string = 'محمد125 hasan '; 
$regex = '~^[\d\p{L}\h]{3,25}$~'; 
if (preg_match($regex, $string, $match) { 
    // do sth. useful here 
} 

a demo on regex101.comを参照してください。

関連する問題