ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jürgen Hauser <>
Subject Remove blank lines
Date Wed, 18 Feb 2004 19:35:25 GMT

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 
needs to be replaced with something, you get the problem ;)

  	    <replaceregexp flags="g" byline="true">
  	        <regexp pattern="^[\s]*$"/>
  	          <substitution expression=""/>
  	          <fileset dir="${dist}">
  		        <filename name="**/*.php"/>

To be honest, what i would really like to achieve is to have it remove 
blank lines only if there are two or more blanklines in a row, so it still 
leaves one blank line.


1. $foo = 'bar';
2. blank line
3. blank line
4. $user =& new User();
5. blank line
6. $user->doSomething();

would result in

1. $foo = 'bar';
2. blank line
3. $user =& new User();
4. blank line
5. $user->doSomething();

Thanks a lot in advance!


To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message