Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 11 May 2000 11:10:15 -0600
From:      Charles Randall <crandall@matchlogic.com>
To:        Dan Larsson <dl@tyfon.net>, questions@freebsd.org
Subject:   RE: regexp driving me nuts, help needed!
Message-ID:  <5FE9B713CCCDD311A03400508B8B3013B256A3@bdr-xcln.is.matchlogic.com>

next in thread | raw e-mail | index | archive | help
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




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?5FE9B713CCCDD311A03400508B8B3013B256A3>