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

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

WBOY
Release: 2016-06-13 13:51:35
Original
816 people have browsed it

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

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

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