From owner-freebsd-questions@FreeBSD.ORG Thu Aug 28 19:04:23 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 AA9CB106567F for ; Thu, 28 Aug 2008 19:04:23 +0000 (UTC) (envelope-from anmichel@gmail.com) Received: from rv-out-0506.google.com (rv-out-0506.google.com [209.85.198.231]) by mx1.freebsd.org (Postfix) with ESMTP id 7774B8FC08 for ; Thu, 28 Aug 2008 19:04:23 +0000 (UTC) (envelope-from anmichel@gmail.com) Received: by rv-out-0506.google.com with SMTP id b25so668507rvf.43 for ; Thu, 28 Aug 2008 12:04:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to :subject:in-reply-to:mime-version:content-type :content-transfer-encoding:content-disposition:references; bh=nfGI8TY4wYobRcSo9GX1kjSZ0eVip3uvlwL1DCnWr5Q=; b=oqQmGC8eafqKQu3evDqXN4zSlnOpYoPO9NlJGFjcHNBccCR14e1MrHBtvpq/ay9Pue 9Az/bBVtBOzKXl/I1+g9bJa5KJJjgjeX+hzr2C5ugTHDXOkBNYZdg005rjB7qgIGMMPz 5dAqgARBtJbEjX5wFv91aekA3fis8vaEJUm1w= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:in-reply-to:mime-version :content-type:content-transfer-encoding:content-disposition :references; b=bcYFjDJflaqREpbZT0ZGCDgvGUK0GhZs6Mptz48vWjaauu7Mph9AXfwZkn036Xwcn3 4AIN46INBl9c8er3VJO8szJRs96iaxfY7aAXYZrY9xWVeIEL6kKgD8WCijf3BEpPQXVU nRr3s4mMTEH8/0meu5GVSE0w1wAqosUz6/BHk= Received: by 10.141.5.3 with SMTP id h3mr976665rvi.138.1219950262118; Thu, 28 Aug 2008 12:04:22 -0700 (PDT) Received: by 10.141.123.18 with HTTP; Thu, 28 Aug 2008 12:04:22 -0700 (PDT) Message-ID: Date: Thu, 28 Aug 2008 15:04:22 -0400 From: An To: "Joseph Olatt" , freebsd-questions@freebsd.org In-Reply-To: <20080828094956.A1175@eskimo.com> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <41baaeae-0c1d-4a73-9540-8049b837261c@l64g2000hse.googlegroups.com> <48B356BE.3080501@datapipe.com> <48B39A4E.1@gmail.com> <20080828094956.A1175@eskimo.com> Cc: 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 19:04:23 -0000 yes, it does work perfectly with the example I gave... the actual file is some like ... 111 1111no 2222 3333 5555 6666 ... your command only returns ]# sed 's/\(.*<\/span>\)\(.*\)\(.*<\/span>\)/\2/' file 5555 I wish to rip all .* and obtain ... 2222 3333 5555 6666 ... i think sed should be able to do it, but the operator [ ^ ( ) ]* is not behaving as i think it would... perl does it alright, though : s thanks, siran On Thu, Aug 28, 2008 at 12:49 PM, Joseph Olatt wrote: > > >> > >>> 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 > > >