From owner-freebsd-current@FreeBSD.ORG Mon Nov 15 02:11:19 2004 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id BE12816A4CE; Mon, 15 Nov 2004 02:11:18 +0000 (GMT) Received: from hotmail.com (bay2-dav16.bay2.hotmail.com [65.54.246.120]) by mx1.FreeBSD.org (Postfix) with ESMTP id 99F9F43D49; Mon, 15 Nov 2004 02:11:18 +0000 (GMT) (envelope-from tssajo@hotmail.com) Received: from mail pickup service by hotmail.com with Microsoft SMTPSVC; Sun, 14 Nov 2004 18:11:17 -0800 Received: from 24.24.201.219 by BAY2-DAV16.phx.gbl with DAV; Mon, 15 Nov 2004 02:10:37 +0000 X-Originating-IP: [24.24.201.219] X-Originating-Email: [tssajo@hotmail.com] X-Sender: tssajo@hotmail.com From: "Zoltan Frombach" To: "Maxime Henrion" References: <1100476106.10768.4.camel@rushlight.kf8nh.com> <20041115014221.GF32839@elvis.mu.org> Date: Sun, 14 Nov 2004 18:10:40 -0800 MIME-Version: 1.0 Content-Type: text/plain; format=flowed; charset="iso-8859-1"; reply-type=original Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2900.2180 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180 Message-ID: X-OriginalArrivalTime: 15 Nov 2004 02:11:17.0798 (UTC) FILETIME=[6440D460:01C4CAB8] cc: freebsd-current@freebsd.org cc: freebsd-stable@freebsd.org Subject: Re: Either I do something wrong or there is a regexp bug in sed !! X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 15 Nov 2004 02:11:19 -0000 Thanks. I will not use the -E flag then. Zoltan > Zoltan Frombach wrote: >> You are right. My mistake. This indeed works: >> >> sed -E -e "s/^[0-9]+/199/" conf-split > conf-split.new >> >> Thanks for clearing this up. > > For what it's worth, there is another way to write this regexp without > using the -E flag. Since x+ == xx*, you can write it: > "s/^[0-9][0-9]*/199/". The reason for not using -E is that it's not > portable, since it's not specified by the standard. GNU sed uses -r for > extended REs. > > Cheers, > Maxime