From owner-freebsd-questions Mon Jul 29 14:40: 8 2002 Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.FreeBSD.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id BEFCC37B400 for ; Mon, 29 Jul 2002 14:40:00 -0700 (PDT) Received: from 216-164-225-145.c3-0.wth-ubr2.sbo-wth.ma.cable.rcn.com (216-164-225-145.c3-0.wth-ubr2.sbo-wth.ma.cable.rcn.com [216.164.225.145]) by mx1.FreeBSD.org (Postfix) with ESMTP id 0AD2F43E3B for ; Mon, 29 Jul 2002 14:40:00 -0700 (PDT) (envelope-from uminac@216-164-225-145.c3-0.wth-ubr2.sbo-wth.ma.cable.rcn.com) Received: from localhost (uminac@localhost) by 216-164-225-145.c3-0.wth-ubr2.sbo-wth.ma.cable.rcn.com (8.11.6/8.11.6) with ESMTP id g6TLeeI37651; Mon, 29 Jul 2002 17:40:41 -0400 (EDT) (envelope-from uminac@216-164-225-145.c3-0.wth-ubr2.sbo-wth.ma.cable.rcn.com) Date: Mon, 29 Jul 2002 17:40:40 -0400 (EDT) From: "Christopher J. Umina" To: Viktor Lazlo Cc: FreeBSD Question Mailing List Subject: Re: matching a string In-Reply-To: <20020729142956.L989-100000@njam.myip.org> Message-ID: <20020729174022.S34156-100000@216-164-225-145.c3-0.wth-ubr2.sbo-wth.ma.cable.rcn.com> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG Perfect! Thank you all, Christopher J. Umina On Mon, 29 Jul 2002, Viktor Lazlo wrote: > > > On Mon, 29 Jul 2002, Christopher J. Umina wrote: > > > Hello, > > > > I'm writing some code to pull screen names out of a log, but I > > can't seem to figure out the regular expressions to get it done. If you > > want to see the log file it's at: > > http://216.164.225.145:81/~uminac/mp3/logs/master > > What I've been looking to make the script do is just list the > > screen names without the brackets, that's all. For instance: > > kelzy16 > > cc skillet > > ccgirl436 > > ccgirl436 > > meikman99 > > bctictac8 > > Exactly which combination of metacharacters, regular expressions and > commands depends on what you are attempting to accomplish in your script > apart from isolating the usernames and by what means, but as a general > example: > > cat master | sed -n 's/.*\[\(.*\)\].*/\1/p' > > should get you near or in the ballpark. > > Cheers, > > Viktor > > To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message