[plug] Re: perl program to strip blank lines from a file

J Michael Gilks mike at gilks1.com
Tue May 18 23:36:29 WST 2004


Sorry, should take more care.
That one will of course only find a blank line with one space, as you pointed 
out.
To find a blank line with zero or more white spaces the pattern is
/^\s*$/
The asterisk is zero repititions, the plus sign is one or more repititions.

Love
Mike.

On Tue, 18 May 2004 03:48 pm, David Buddrige wrote:
> J Michael Gilks writes:
> > RegEx needs to find any whitespace on a blank line, so
> > /^\s$/
> > will do the trick.
>
> Will this only find a line that contains a single whitespace (or tab)?  For
> instance, if a line is:
>
> \t\t\n
>
> Will this be picked up?
>
> To pick up this, what about
>
>    /^\s*$/
>
> or
>
>    /^\s+$/
>
> thanks
>
>
> David.
>
> thanks
>
> David. 8-)
> _______________________________________________
> PLUG discussion list: plug at plug.linux.org.au
> http://mail.plug.linux.org.au/cgi-bin/mailman/listinfo/plug
> Committee e-mail: committee at plug.linux.org.au



More information about the plug mailing list