From owner-freebsd-questions Thu May 11 10:10:35 2000 Delivered-To: freebsd-questions@freebsd.org Received: from houston.matchlogic.com (houston.matchlogic.com [205.216.147.127]) by hub.freebsd.org (Postfix) with ESMTP id 4906137BD4F for ; Thu, 11 May 2000 10:10:30 -0700 (PDT) (envelope-from crandall@matchlogic.com) Received: by houston.matchlogic.com with Internet Mail Service (5.5.2650.21) id ; Thu, 11 May 2000 11:10:24 -0600 Message-ID: <5FE9B713CCCDD311A03400508B8B3013B256A3@bdr-xcln.is.matchlogic.com> From: Charles Randall To: Dan Larsson , questions@freebsd.org Subject: RE: regexp driving me nuts, help needed! Date: Thu, 11 May 2000 11:10:15 -0600 MIME-Version: 1.0 X-Mailer: Internet Mail Service (5.5.2650.21) Content-Type: text/plain; charset="iso-8859-1" Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG If you can assume that the URLs are syntactically correct, % echo http://www.domain.com/html.asp | cut -d/ -f3 www.domain.com -Charles -----Original Message----- From: Dan Larsson [mailto:dl@tyfon.net] Sent: Thursday, May 11, 2000 10:43 AM To: questions@freebsd.org Subject: regexp driving me nuts, help needed! I need to get the domain and tld from an url. this my idea of what would match and return 'domain.com': echo http://www.domain.com/html.asp | sed -e 's/\([\.a-zA-Z0-9]+[a-zA-Z]{2,3}\)/\1 /g' But that's not what sh thinks ( it returns the whole url ) What regexp should I use to get the desired result? Regards ------------ Dan Larsson To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message