From owner-freebsd-questions@FreeBSD.ORG Thu Aug 28 16:50:01 2008 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E3D071065673 for ; Thu, 28 Aug 2008 16:50:01 +0000 (UTC) (envelope-from joji@eskimo.com) Received: from ultra5.eskimo.com (ultra5.eskimo.com [204.122.16.68]) by mx1.freebsd.org (Postfix) with ESMTP id BFFC48FC14 for ; Thu, 28 Aug 2008 16:50:01 +0000 (UTC) (envelope-from joji@eskimo.com) Received: from eskimo.com (eskimo.com [204.122.16.13]) by ultra5.eskimo.com (8.14.3/8.14.0) with ESMTP id m7SGnvXE003315; Thu, 28 Aug 2008 09:49:57 -0700 Received: (from joji@localhost) by eskimo.com (8.9.1a/8.9.1) id JAA01435; Thu, 28 Aug 2008 09:49:57 -0700 (PDT) Date: Thu, 28 Aug 2008 09:49:57 -0700 From: Joseph Olatt To: An Message-ID: <20080828094956.A1175@eskimo.com> References: <41baaeae-0c1d-4a73-9540-8049b837261c@l64g2000hse.googlegroups.com> <48B356BE.3080501@datapipe.com> <48B39A4E.1@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5.1i In-Reply-To: ; from anmichel@gmail.com on Tue, Aug 26, 2008 at 07:34:57AM -0400 Cc: freebsd-questions@freebsd.org Subject: Re: sed html tags 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: Thu, 28 Aug 2008 16:50:02 -0000 > > >>> Hi, I have the string > > >>> > > >>> 111 2222 3333 > > >>> > > >>> And i wish to use sed to strip *only* the "" tag and its > > >>> contents... is this possible ? I'm trying this expression, but it > > >>> doesn't work... > > >>> > > >>> sed 's/\)]+<\/span>//g' file > > >>> > > >>> is there anything like it ? > > >>> > > >>> I would like to obtain > > >>> > > >>> 2222 > > >>> > > >>> > > >>> > > >>> I hope someone can help, > > >>> > > >>> thank you, > > >>> > > >>> siran If you haven't yet solved the above problem, give the following a try: sed 's/\(.*<\/span>\)\(.*\)\(.*<\/span>\)/\2/' regards, joseph