【发布时间】:2017-07-07 23:35:16
【问题描述】:
我想替换一个点,后跟一个空格,后跟一个大写,我尝试使用这种模式将它替换为   :
preg_replace('/\. [A-Z]/', '. 'With marriage came a move to the beautiful Birmingham, Alabama area. Diving in head first.');
它正在工作,但我首先失去了 Diving 的 D。
我怎样才能保留它?
【问题讨论】:
-
'/\.\s+(?=[A-Z])/' -
preg_replace('/\. ([A-Z])/', '. $1',$s ); $s 是你的字符串