Home >Backend Development >PHP Tutorial >【正则表达式有关问题】如何匹配单独(两端非空格)的2个空格

【正则表达式有关问题】如何匹配单独(两端非空格)的2个空格

WBOY
WBOYOriginal
2016-06-13 10:24:281293browse

【正则表达式问题】怎么匹配单独(两端非空格)的2个空格


比如: aa--bb 这样的匹配两个空格,aa----bb这样的不匹配。

注释: “-”表示一个空格

------解决方案--------------------
这个意思?

PHP code
$s = <font color="#e78608">------解决方案--------------------</font><br>echo preg_replace('/(?');<div class="clear">
                 
              
              
        
            </div>
Statement:
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