Return-Path: Delivered-To: apmail-ant-user-archive@www.apache.org Received: (qmail 52478 invoked from network); 18 Feb 2004 23:29:35 -0000 Received: from daedalus.apache.org (HELO mail.apache.org) (208.185.179.12) by minotaur-2.apache.org with SMTP; 18 Feb 2004 23:29:35 -0000 Received: (qmail 22471 invoked by uid 500); 18 Feb 2004 23:29:12 -0000 Delivered-To: apmail-ant-user-archive@ant.apache.org Received: (qmail 22408 invoked by uid 500); 18 Feb 2004 23:29:11 -0000 Mailing-List: contact user-help@ant.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Subscribe: List-Help: List-Post: List-Id: "Ant Users List" Reply-To: "Ant Users List" Delivered-To: mailing list user@ant.apache.org Received: (qmail 22395 invoked from network); 18 Feb 2004 23:29:11 -0000 Received: from unknown (HELO relay2.hrnoc.net) (216.120.237.254) by daedalus.apache.org with SMTP; 18 Feb 2004 23:29:11 -0000 Received: from smtp-1.hrnoc.net ([216.120.225.37]) by relay2.hrnoc.net with esmtp (Exim 4.30; FreeBSD) id 1Atb86-0003BJ-Mb for user@ant.apache.org; Wed, 18 Feb 2004 18:29:22 -0500 Received: (qmail 14900 invoked by uid 509); 18 Feb 2004 23:28:47 -0000 Received: from josep.rio@uworks.net by smtp-1.hrnoc.net by uid 89 with qmail-scanner-1.20st (clamuko: 0.65. spamassassin: 2.63. Clear:RC:1(62.57.159.66):. Processed in 0.075543 secs); 18 Feb 2004 23:28:47 -0000 X-Qmail-Scanner-Mail-From: josep.rio@uworks.net via smtp-1.hrnoc.net X-Qmail-Scanner: 1.20st (Clear:RC:1(62.57.159.66):. Processed in 0.075543 secs) Received: from docsis159-66.menta.net (HELO ryoohki) (josep.rio@uworks.net@62.57.159.66) by smtp-1.hrnoc.net with SMTP; 18 Feb 2004 23:28:46 -0000 From: =?iso-8859-1?Q?Josep_del_R=EDo?= To: "'Ant Users List'" Subject: RE: Remove blank lines Date: Thu, 19 Feb 2004 00:28:48 +0100 Organization: uWorks Message-ID: <002101c3f676$f6991ff0$429f393e@ryoohki> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable X-Priority: 3 (Normal) X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook, Build 10.0.2627 Importance: Normal X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165 In-Reply-To: <6.0.0.22.2.20040218203125.01f2a008@in.telenet.be> X-HR-Scan-Signature: d0e0718343e35f5df85e7e2eafe493bf X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N X-Spam-Rating: minotaur-2.apache.org 1.6.2 0/1000/N I think that the following should do the trick: Where "\r\n[\s]*\r\n[\s]*\r\n" means 2 blank lines and " " means 1 blank line, so the maximum of blank lines will be 1. -----Original Message----- From: J=FCrgen Hauser [mailto:hauser@pandora.be]=20 Sent: mi=E9rcoles, 18 de febrero de 2004 20:35 To: user@ant.apache.org Subject: Remove blank lines Hi, I'm having troubles finding out how to actually remove blank lines. I have a regular expression which will match all blank lines, but since it=20 needs to be replaced with something, you get the problem ;) =09 To be honest, what i would really like to achieve is to have it remove=20 blank lines only if there are two or more blanklines in a row, so it still=20 leaves one blank line. ie. 1. $foo =3D 'bar'; 2. blank line 3. blank line 4. $user =3D& new User(); 5. blank line 6. $user->doSomething(); would result in 1. $foo =3D 'bar'; 2. blank line 3. $user =3D& new User(); 4. blank line 5. $user->doSomething(); Thanks a lot in advance! Regards, J=FCrgen --------------------------------------------------------------------- To unsubscribe, e-mail: user-unsubscribe@ant.apache.org For additional commands, e-mail: user-help@ant.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: user-unsubscribe@ant.apache.org For additional commands, e-mail: user-help@ant.apache.org