From owner-freebsd-current@FreeBSD.ORG Mon Nov 15 00:12:02 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 D423316A4CE for ; Mon, 15 Nov 2004 00:12:02 +0000 (GMT) Received: from ns.nnt.ru (ns.nnt.ru [217.72.1.2]) by mx1.FreeBSD.org (Postfix) with ESMTP id 7FA5543D2F for ; Mon, 15 Nov 2004 00:12:02 +0000 (GMT) (envelope-from nobody@ns.nnt.ru) Received: from drweb by ns.nnt.ru with drweb-scanned (Exim 3.36 #1) id 1CTUOt-000Ksa-00 for freebsd-current@freebsd.org; Mon, 15 Nov 2004 03:07:19 +0300 Received: from nobody by ns.nnt.ru with local (Exim 3.36 #1) id 1CTUOr-000Kqx-00; Mon, 15 Nov 2004 03:07:17 +0300 Received: from mx2.freebsd.org ([216.136.204.119]) by ns.nnt.ru with esmtp (Exim 3.36 #1) id 1CTUOq-000Kp1-00 for goblin@nnt.ru; Mon, 15 Nov 2004 03:07:17 +0300 Received: from hub.freebsd.org (hub.freebsd.org [216.136.204.18]) by mx2.freebsd.org (Postfix) with ESMTP id A025A579CD; Mon, 15 Nov 2004 00:06:32 +0000 (GMT) (envelope-from owner-freebsd-stable@freebsd.org) Received: from hub.freebsd.org (localhost [127.0.0.1]) by hub.freebsd.org (Postfix) with ESMTP id 392FC16A5AC; Mon, 15 Nov 2004 00:06:15 +0000 (GMT) Delivered-To: freebsd-stable@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 7930F16A4CE; Mon, 15 Nov 2004 00:06:02 +0000 (GMT) Received: from hotmail.com (bay2-dav8.bay2.hotmail.com [65.54.246.112]) by mx1.FreeBSD.org (Postfix) with ESMTP id 580E643D1D; Mon, 15 Nov 2004 00:06:02 +0000 (GMT) (envelope-from tssajo@hotmail.com) Received: from mail pickup service by hotmail.com with Microsoft SMTPSVC; Sun, 14 Nov 2004 16:06:01 -0800 Received: from 24.24.201.219 by BAY2-DAV8.phx.gbl with DAV; Mon, 15 Nov 2004 00:05:14 +0000 X-Originating-IP: [24.24.201.219] X-Originating-Email: [tssajo@hotmail.com] X-Sender: tssajo@hotmail.com From: "Zoltan Frombach" To: "Brandon S. Allbery KF8NH" References: <1100476106.10768.4.camel@rushlight.kf8nh.com> Date: Sun, 14 Nov 2004 16:05:15 -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 00:06:01.0905 (UTC) FILETIME=[E46E9210:01C4CAA6] X-BeenThere: freebsd-stable@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list Errors-To: owner-freebsd-stable@freebsd.org X-bogoflag: true X-2Bogosity: No, tests=bogofilter, spamicity=0.543619, version=0.92.8 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 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 00:12:03 -0000 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. Zoltan > On Sun, 2004-11-14 at 18:39, Zoltan Frombach wrote: >> match anything! After spending like an hour investigating this, I >> realized >> that the + after my bracket expression ( I'm talking about this part >> here: > > Normal. > >> According to the sed man page, the regexp syntax that is used by sed is >> documented in the re_format man page. And according to the re_format man >> page: "A piece is an atom possibly followed by a single= `*', `+', `?', >> or > > You need to read it more carefully. There are two kinds of regular > expressions, "basic" and "extended". sed, ed, and grep speak BRE > syntax, whereas awk and egrep speak ERE syntax. + is special only in > ERE syntax. > > (And then there's GNU, where the difference between BRE and ERE is that > some things use a preceding backslash in BRE and don't in ERE, and vice > versa, so GNU sed does what you want if you use \+ instead of +.) > > -- > brandon s. allbery [linux,solaris,freebsd,perl] allbery@kf8nh.com > system administrator [WAY too many hats] allbery@ece.cmu.edu > electrical and computer engineering, carnegie mellon univ. KF8NH _______________________________________________ freebsd-stable@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-stable To unsubscribe, send any mail to "freebsd-stable-unsubscribe@freebsd.org"