Home > Backend Development > PHP Tutorial > How to match slash in php regular expression

How to match slash in php regular expression

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
Release: 2016-07-06 13:53:25
Original
2302 people have browsed it

<code>preg_match_all('/ue[0-9]{3}/', '\ue412大猫 \ue413', $res);
   p($res);</code>
Copy after login
Copy after login
<code>Array
(
    [0] => Array
        (
            [0] => ue412
            [1] => ue413
        )

)</code>
Copy after login
Copy after login

我是要匹配出ue412和ue413的。。但是把正则改成'/\ue[0-9]{3}/'或者'/ue[0-9]{3}/',他就什么都不匹配出来了

回复内容:

<code>preg_match_all('/ue[0-9]{3}/', '\ue412大猫 \ue413', $res);
   p($res);</code>
Copy after login
Copy after login
<code>Array
(
    [0] => Array
        (
            [0] => ue412
            [1] => ue413
        )

)</code>
Copy after login
Copy after login

我是要匹配出ue412和ue413的。。但是把正则改成'/\ue[0-9]{3}/'或者'/ue[0-9]{3}/',他就什么都不匹配出来了

<code>/\\\~~~~~~~~~~~/</code>
Copy after login

已经解决了。。原来三个斜杠就可以了

Related labels:
php
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Latest Issues
php data acquisition?
From 1970-01-01 08:00:00
0
0
0
PHP extension intl
From 1970-01-01 08:00:00
0
0
0
How to learn php well
From 1970-01-01 08:00:00
0
0
0
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template