From owner-freebsd-questions Fri May 12 1:37:25 2000 Delivered-To: freebsd-questions@freebsd.org Received: from hq1.tyfon.net (hq1.tyfon.net [213.212.29.17]) by hub.freebsd.org (Postfix) with ESMTP id 4AD3837BFB1 for ; Fri, 12 May 2000 01:37:20 -0700 (PDT) (envelope-from dl@tyfon.net) Received: from enigmatic (dan [192.168.1.20]) by hq1.tyfon.net (Postfix) with SMTP id 721201C7B6 for ; Fri, 12 May 2000 10:37:17 +0200 (CEST) From: "Dan Larsson" To: Subject: RE: regexp driving me nuts, help needed! (followup) Date: Fri, 12 May 2000 10:39:00 +0200 Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 (Normal) X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook IMO, Build 9.0.2416 (9.0.2910.0) In-Reply-To: <200005111743.9399@tulip.eng.cam.ac.uk> X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2314.1300 Importance: Normal Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG Thanks for all the help guys (you know who you are)! Now I can extract 'sub.domain.tld/file.html' to 'domain.tld'. Thanks! However I need to extract and return second level domainname with top level domainname from any combination: https://foo.bar.sub.domain.tld/anythingornothing/file.html gopher://anything.domain.tld/nothingoranything/foo.file anything://domain.tld/file.php3 http://domain.tld/ telnet://domain.tld should all return: 'domain.tld'. Maybe I'm reaching in the wrong direction when trying to use regexps for this. Any other method is also welcome. Regards ------------ Dan Larsson To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message