Page is a not externally linkable
- Code, Content, and Presentation
-- Perl Server Side CGI Scripting
---- Perl pattern match for url


Gibble - 5:55 pm on Jul 22, 2009 (gmt 0)


I recommend you get the tool called expresso to help you write regular expressions

your regex of /www\.\s+\.com/
matches www.(whitespace).com

It also has a few expressions in the library such as this one for URLs:
(?<Protocol>\w+):\/\/(?<Domain>[\w@][\w.:@]+)\/?[\w\.?=%&=\-@/$,]*

Which since you aren't starting your match with "protocol://", but with "www."
can be changed to
/www.(?<Domain>[\w@][\w.:@]+)\/?[\w\.?=%&=\-@/$,]*/


Thread source:: http://www.webmasterworld.com/perl/3956870.htm
Brought to you by WebmasterWorld: http://www.webmasterworld.com