Home > Backend Development > PHP Tutorial > php函数preg_match_all的匹配用jquery如何写

php函数preg_match_all的匹配用jquery如何写

WBOY
Release: 2016-06-13 10:50:46
Original
914 people have browsed it

php函数preg_match_all的匹配用jquery怎么写
$s = [email protected]@[email protected] @d ceff @e';
$pattern = '/@[^\s|@]+/';
preg_match_all($pattern, $s, $match);
echo '

';<br>print_r($match);<br><br>结果:<br>Array<br>(<br>     [0] => Array<br>         (<br>             [0] => @放<br>             [1] => @b3<br>             [2] => @c<br>             [3] => @d<br>             [4] => @e<br>         )<br><br>)<br><br>php能匹配出所有的,[email protected],是怎么回事,怎么匹配出所有的?<br><br><font color="#e78608">------解决方案--------------------</font><br>var reg = /@[^\s|@]+/g;<br><br>g 全程的<br><br>有没有 g 的区别和<br>preg_match 和 preg_match_all<br>的区别一般<div class="clear">
                 
              
              
        
            </div>
Copy after login
Related labels:
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template