阿拉伯语字母数字,只有空格正则表达式

Sai*_*akR 2 php regex arabic phpbb3

我想知道以下的等价物,但仅限阿拉伯字母:

$regex = '[A-Za-z0-9-[\]_+ ]+'
Run Code Online (Sandbox Code Playgroud)

我试过了:

$regex = '[?-?0-9 ]+';
Run Code Online (Sandbox Code Playgroud)

其中第一个阿拉伯字母?和最后一个字母?.但是,我有以下错误:

[phpBB Debug] PHP Warning: 
in file [ROOT]/includes/functions_user.php on line 1505: preg_match():
Compilation failed: range out of order in character class at offset 6
Run Code Online (Sandbox Code Playgroud)

Ped*_*ito 5

您可以检查您的正则表达口味是否支持\p{Arabic}\p{InArabic}

尝试:

$regex = '[\p{Arabic}\d-\[\]_+ ]+'
Run Code Online (Sandbox Code Playgroud)