Date: Mon, 11 Nov 2002 23:35:17 +0100 From: Benoit Lacherez <blacherez@ac-bordeaux.fr> To: John Von Essen <john@essenz.com> Cc: questions@FreeBSD.ORG Subject: Re: awk to remove backet Message-ID: <20021111233517.A28946@milouz.boece.foo> In-Reply-To: <B17BFFD2-F5C3-11D6-AC50-0003933DDCFA@essenz.com>; from john@essenz.com on Mon, Nov 11, 2002 at 05:19:49PM -0500 References: <20021111225743.A7718@milouz.boece.foo> <B17BFFD2-F5C3-11D6-AC50-0003933DDCFA@essenz.com>
next in thread | previous in thread | raw e-mail | index | archive | help
John Von Essen a écrit : > Im confused. > > Wouldn't s/(\([^)]*\))/\1/g just replace exactly what it finds? I think > the outer ()'s got mixed up. No. sed doesn't use extended regex so the special character is \( and the literal bracket is (. The easiest is to try: % echo '(abc.com)' | sed 's/(\([^)]*\))/\1/g' abc.com % echo '(abc.com)' | sed 's/\(([\w]+)\)/\1/g' (abc.com) > > To take (hello) and change it to hello, you would do: > > sed 's/\(([\w]+)\)/\1/g' > > \w is fine if you only want the cases where text only is inside. > > -John Von Essen > > On Monday, November 11, 2002, at 04:57 PM, Benoit Lacherez wrote: > > > What about sed 's/(\([^)]*\))/\1/g' ? > > > To Unsubscribe: send mail to majordomo@FreeBSD.org > with "unsubscribe freebsd-questions" in the body of the message -- Benoit Lacherez Académie de Bordeaux -- CATICE Projet de traduction de la documentation de Python: http://frpython.sourceforge.net/ To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20021111233517.A28946>