From owner-freebsd-questions@FreeBSD.ORG Tue Aug 26 04:19:53 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 27BE4106564A for ; Tue, 26 Aug 2008 04:19:53 +0000 (UTC) (envelope-from anmichel@gmail.com) Received: from rv-out-0506.google.com (rv-out-0506.google.com [209.85.198.228]) by mx1.freebsd.org (Postfix) with ESMTP id DFA368FC1F for ; Tue, 26 Aug 2008 04:19:52 +0000 (UTC) (envelope-from anmichel@gmail.com) Received: by rv-out-0506.google.com with SMTP id b25so2997120rvf.43 for ; Mon, 25 Aug 2008 21:19:52 -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:cc:in-reply-to:mime-version:content-type:references; bh=LF2GQuOIexH+mwNrKMjfE1ectvemviFMOxXgw08ZxFg=; b=JMMCJOrWh501SNwNG27pl8rR6b9PSR3PSmhmZFX9KNYMPNIyazZ8K0K6hI0cAaby4/ bedd5TGlWbzhVXAFaLm8itpeMv78+S0cZBVYsQcmLruVEQ+mHtpEKvfOqtjxf7SxqD7D yLultUULYS8Ah+UQJkpNIr8lTJM8DO3Cj2Zak= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:cc:in-reply-to:mime-version :content-type:references; b=I45s3RkbklrvETes9t0F8V0mT2cx85PhiG72eGpHR6iTC9NyimESk8+K7836SUUs3r hTUAK/Y6PCrXQ8UzAKX+b/78aNVs4GiwZJOb2A9Zt+6V6vnUj08+C2S+bZRX8Wb4n86K BHhQXvCmJpiPV7kpEEhZShOFwJDn7lH9J1esE= Received: by 10.141.123.4 with SMTP id a4mr2560147rvn.294.1219724392196; Mon, 25 Aug 2008 21:19:52 -0700 (PDT) Received: by 10.141.123.18 with HTTP; Mon, 25 Aug 2008 21:19:52 -0700 (PDT) Message-ID: Date: Mon, 25 Aug 2008 23:49:52 -0430 From: An To: "Paul A. Procacci" In-Reply-To: <48B356BE.3080501@datapipe.com> MIME-Version: 1.0 References: <41baaeae-0c1d-4a73-9540-8049b837261c@l64g2000hse.googlegroups.com> <48B356BE.3080501@datapipe.com> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline X-Content-Filtered-By: Mailman/MimeDel 2.1.5 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: Tue, 26 Aug 2008 04:19:53 -0000 unfortunately not... see: # cat file 111 2222 3333 # sed -e 's/<\/?span[^>]*>//g' file 111 2222 3333 (...nothing happens, the file is returned with no substitutions done) I could do it with a perl script, which basically does what i would expect sed would do: # cat pscript.pl #!/usr/bin/perl -w $text = " 111 2222 3333 111 2222 3333 "; $text =~ s/]*>[^\(<\/span>\)]*[\s]*<\/span>[\s]*//g; print $text . "\n" # perl pscript.pl 2222 3333 2222 3333 " ..... " is removed... but i don't seem to be able to do it with sed... : ( Im on fedora c9, maybe that's the problem ? siran On Mon, Aug 25, 2008 at 8:35 PM, Paul A. Procacci wrote: > siran 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 >> _______________________________________________ >> freebsd-questions@freebsd.org mailing list >> http://lists.freebsd.org/mailman/listinfo/freebsd-questions >> To unsubscribe, send any mail to " >> freebsd-questions-unsubscribe@freebsd.org" >> >> > sed -E 's/<\/?span[^>]*>//g' > > Myabe that's what you want? >