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

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
Release: 2016-07-13 09:56:55
Original
919 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:
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
Latest Issues
php data acquisition?
From 1970-01-01 08:00:00
0
0
0
PHP extension intl
From 1970-01-01 08:00:00
0
0
0
How to learn php well
From 1970-01-01 08:00:00
0
0
0
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template