How to extract the toplevel-domain of a domainame from a string with regexp 
Author Message
 How to extract the toplevel-domain of a domainame from a string with regexp

Hi,

hope to not annoinng somebody with the question.
question:

i have a name of a domain in a string called $foo
supposed there are these contents in $foo

1:) meinedomain.de need result in $foo2 .de
2:) somewhere.com need result in  $foo2 .com

i don't want to use substr, it must be able to use a regexp !!!!

thanxs for any help

ingo

--
Ingo Trapphagen
Winstar Communications GmbH             Fon:   +49 (0) 211 9302780
Lorettostrasse 1                        Fax:   +49 (0) 211 9302794



Sun, 13 Jul 2003 21:22:19 GMT  
 How to extract the toplevel-domain of a domainame from a string with regexp
i have a name of a domain in a string called $foo
supposed there are these contents in $foo
1:) meinedomain.de need result in $foo2 .de
2:) somewhere.com need result in  $foo2 .com

i don't want to use substr, it must be able to use a regexp !!!!

($foo2) = $foo =~ m!(\.\w+)$!;



Sun, 13 Jul 2003 22:06:53 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. need regex to extract domain.name from host.domain.name

2. Extracting strings from postscript in a single regexp?

3. extracting domains from whois query

4. extracting domain names

5. Extracting top level domain from remote host

6. Extracting Domain

7. Extracting Domain

8. extract string from another string

9. regular expression to extract a string between 2 other strings

10. regexp for IP address / host-domain

11. Extract string from a string

12. extracting a chunk with regexp?

 

 
Powered by phpBB® Forum Software