From owner-freebsd-questions Thu May 11 13: 6:27 2000 Delivered-To: freebsd-questions@freebsd.org Received: from larryboy.graphics.cornell.edu (larryboy.graphics.cornell.edu [128.84.247.48]) by hub.freebsd.org (Postfix) with ESMTP id 4648C37B556 for ; Thu, 11 May 2000 13:06:25 -0700 (PDT) (envelope-from mkc@larryboy.graphics.cornell.edu) Received: from larryboy.graphics.cornell.edu (mkc@localhost) by larryboy.graphics.cornell.edu (8.9.3/8.9.3) with ESMTP id QAA87986; Thu, 11 May 2000 16:06:17 -0400 (EDT) (envelope-from mkc@larryboy.graphics.cornell.edu) Message-Id: <200005112006.QAA87986@larryboy.graphics.cornell.edu> To: Charles Randall Cc: Dan Larsson , questions@FreeBSD.ORG Subject: Re: regexp driving me nuts, help needed! In-Reply-To: Message from Charles Randall of "Thu, 11 May 2000 13:56:10 MDT." <5FE9B713CCCDD311A03400508B8B3013B256B8@bdr-xcln.is.matchlogic.com> Date: Thu, 11 May 2000 16:06:17 -0400 From: Mitch Collinsworth Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG >That seems like a lot of work, > >% echo http://www.domain.com/www.blah/html.asp | perl -ne 'print $1,"\n" if >m|http://www\.([^/]+)|i' >domain.com > >This will work with a big list of URLs on stdin. But only as long as they all have "www." in the domain name: % echo http://domain.com/www.blah/html.asp | perl -ne 'print $1,"\n" if m|http://www\.([^/]+)|i' % Woops. I guess mine is more flexible: % echo http://domain.com/www.blah/html.asp |\ perl -e '$u=<>; $u=~s/http:\/\///; $u=~s/^www.//i; $u=~s/\/.*$//; print $u' domain.com -Mitch To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message