正则 [^.]+ 是什么意思?
尼古拉阿列克塞耶维奇奥斯特洛夫斯基
尼古拉阿列克塞耶维奇奥斯特洛夫斯基 2017-02-13 11:21:00
0
2
2682

不是字符!那是什么呢?

尼古拉阿列克塞耶维奇奥斯特洛夫斯基
尼古拉阿列克塞耶维奇奥斯特洛夫斯基

reply all(2)
数据分析师

Regular [^.]+What does it mean? -PHP Chinese website Q&A-Regular [^.]+What does it mean? -PHP Chinese website Q&A

Let’s take a look and learn.

巴扎黑
preg_match_all('/[^.]+/', 'ab.cd.rf', $m);
print_r($m);
/*
Array
(
    [0] => Array
        (
            [0] => ab
            [1] => cd
            [2] => rf
        )
)
*/

方括号表示的是一个字符列表,[^.] 表示的是除了 . 以外的字符,而不是什么 不是字符

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!