【发布时间】:2016-06-10 18:16:57
【问题描述】:
我需要一个 Php-RegEx 来查找开始关键字和结束关键字之间的所有双空格并删除它们。
$teststring = 'This is a teststring ... :keyword_start: this is the content with double spaces :keyword_end: more text ... :keyword_start: this is the second content with double spaces :keyword_end: ... more text';
我需要以下结果:
This is a teststring ... :keyword_start: this is the content with double spaces :keyword_end: more text ... :keyword_start: this is the second content with double spaces :keyword_end: ... more text
这是我尝试过的:(但它不起作用)
$teststring = preg_replace('#(:keyword_start:)\s\s+(:keyword_end:)#si', '', $teststring);
谁能帮帮我?
【问题讨论】: