Home > Backend Development > PHP Tutorial > PHP and editplus regular expression to remove blank lines, editplus regular expression_PHP tutorial

PHP and editplus regular expression to remove blank lines, editplus regular expression_PHP tutorial

WBOY
Release: 2016-07-13 09:56:55
Original
868 people have browsed it

php and editplus regular expressions remove blank lines, editplus regular expressions

remove blank lines inside the string:
Copy code The code is as follows:
$str = preg_replace("/(s*?r?ns*?) /","n",$str);

Remove all blank lines, including internal and trailing lines:
Copy code The code is as follows:
$str = preg_replace('/($s*$)|(^s*^)/m', '',$str);

Regular expression to replace blank lines in editplus:

Regular expression: ^[tn]*n

www.bkjia.comtruehttp: //www.bkjia.com/PHPjc/985271.htmlTechArticlephp and editplus regular expressions remove blank lines, and editplus regular expressions remove blank lines inside the string: Copy code The code is as follows: $str = preg_replace("/(s*rns*) /","n",$str)...
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