From owner-freebsd-questions@FreeBSD.ORG Sat Aug 26 10:38:50 2006 Return-Path: X-Original-To: freebsd-questions@freebsd.org Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id EC42716A4DF for ; Sat, 26 Aug 2006 10:38:50 +0000 (UTC) (envelope-from mjkarki@gmail.com) Received: from ug-out-1314.google.com (ug-out-1314.google.com [66.249.92.173]) by mx1.FreeBSD.org (Postfix) with ESMTP id 4B0B243D6D for ; Sat, 26 Aug 2006 10:38:50 +0000 (GMT) (envelope-from mjkarki@gmail.com) Received: by ug-out-1314.google.com with SMTP id m2so1184287uge for ; Sat, 26 Aug 2006 03:38:49 -0700 (PDT) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:sender:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references:x-google-sender-auth; b=JT4CiIylf1dpyJ6IsF5kuB7qOKR1PtAQ9VjxctGJFsXY6VWmTQyx30VIQLGiAjdOfvw8cgYoxOK6tLYJ+lGhSFbFGxkXfhK9JupZut98eKubvD4wNz6s5brgA5VZlO9y1dkSfeaa3YGzXn/dRvNRpISaaWTgo3wGB1t9DgjFuZY= Received: by 10.67.97.7 with SMTP id z7mr2440988ugl; Sat, 26 Aug 2006 03:38:49 -0700 (PDT) Received: by 10.67.101.7 with HTTP; Sat, 26 Aug 2006 03:38:49 -0700 (PDT) Message-ID: <1b15366e0608260338l2f4f0d20t1730e02f74a88ba2@mail.gmail.com> Date: Sat, 26 Aug 2006 13:38:49 +0300 From: "Matti J. Karki" Sender: mjkarki@gmail.com To: "James Long" In-Reply-To: <20060826053106.GA81153@ns.museum.rain.com> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <20060825204853.CD31D16A57C@hub.freebsd.org> <20060826053106.GA81153@ns.museum.rain.com> X-Google-Sender-Auth: b4172a4f94321854 Cc: freebsd-questions@freebsd.org Subject: Re: Code beautifiers, anyone? X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 26 Aug 2006 10:38:51 -0000 On 8/26/06, James Long wrote: > > > > > inbuffer = re.sub('\n +', '\n', inbuffer) # Strip trailing whitespace > > > > This will strip spaces at the _beginning_ of line (leading spaces). > > Except, possibly, lines that begin at the first byte of the buffer, > such as the first line of the file, and any other lines that happen to > land across the buffer boundary just so. > Nice catch. I hadn't thought about that. -Matti