Home  >  Article  >  Backend Development  >  这个正则帮解释一下!该如何处理

这个正则帮解释一下!该如何处理

WBOY
WBOYOriginal
2016-06-13 13:51:35771browse

这个正则帮解释一下!
下了一个发送邮件类,里面有个正则没看懂:
$body = ereg_replace("(^|(\r\n))(\.)", "\1.\3", $body);

------解决方案--------------------
每行第一个点.替换成 \1.\3
------解决方案--------------------
\1代表第一个匹配到的组,也就是(^|(\r\n))。
\3代表第三个匹配到的组,也就是(\.)

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