gpt4 book ai didi

php - 仅带空格的阿拉伯字母数字正则表达式

转载 作者:行者123 更新时间:2023-12-03 21:38:29 33 4
gpt4 key购买 nike

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

$regex = '[A-Za-z0-9-[\]_+ ]+'

我试过了:

$regex = '[ا-ئ0-9 ]+';

其中第一个阿拉伯字母ا和最后一个ئ。但是,我收到以下错误:

[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

最佳答案

您可以检查您的 Regex 风格是否支持 \p{Arabic}\p{InArabic}

尝试:

$regex = '[\p{Arabic}\d-\[\]_+ ]+'

关于php - 仅带空格的阿拉伯字母数字正则表达式,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23163490/

33 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com