[geeks] Quick sed question

Jonathan C. Patschke jp at celestrion.net
Sat Jun 22 11:13:22 CDT 2002


On Sat, 22 Jun 2002, alex j avriette wrote:

> >> 	sed -e 's/^[ 	]*//'
> >
> > Or more efficiently :
> >
> > sed -e 's/^[     ]+//'
>
> well sure its a little more efficient, but its not the same expression.

I fail to see how it matters in this case.  Replacing zero or more
instances of something with nothing should have an result equivalent to
replacing one or more instances of something with nothing.  It's a case of
an optimization that cannot be applied universally.

--Jonathan



More information about the geeks mailing list