如何使用半空格(unicode U+2005)在php正则表达式


how to use semi-space (unicode U+2005) in php regex

我在php中有一个regex检测标签和它后面的单词。这样我就可以在post和search中使用这个词作为标签等等。

这是我的正则表达式:

        if( preg_match_all('/'#([א-תآ-یÀ-ÿ一-龥а-яا-یa-z0-9'-_]{1,50})/iu', $message, $matches, PREG_PATTERN_ORDER) ) {
    foreach($matches[1] as $tg) {
        $this->posttags[]   = mb_strtolower(trim($tg));
    }
}

我想要的是这个正则表达式包括半空格(Unicode U+2005的1/4空格)

在正则表达式中使用转义字符'x{2005}

测试:https://regex101.com/r/hG7rN3/1