Re: how to strip empty lines out of a txt using preg_replace()
| From: | Ashley Sheridan | Date: | Fri, 04 Sep 2009 13:05:39 +0000 |
| Subject: | Re: how to strip empty lines out of a txt using preg_replace() | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-297667@lists.php.net to get a copy of this message | ||
On Fri, 2009-09-04 at 14:58 +0200, Ralph Deffke wrote:
> Hi all, I'm a bit under stress, maybe somebody knows the regex on a snap.
> using PHP_EOL would be great.
>
> thanks
> ralph_deffke@yahoo.de
>
>
>
The regex that would match a line containing only whitespace would look
like this:
^\s*$
Thanks,
Ash
http://www.ashleysheridan.co.uk