Re: Matching the domain of a URL

2007-03-15 Thread Igor Sutton Lopes
On 2007/03/15, at 18:29, Jenda Krynicky wrote: From: Igor Sutton Lopes <[EMAIL PROTECTED]> my @possible_values = qw{ http://www.google.com https://my.domain. http://some.other.domain.net }; my @urls = qw{ http://www.google.com/?some_bizarre_args https://my.domain.com https:

Re: Matching the domain of a URL

2007-03-15 Thread Grant
> I ended up going with this: > if ($Scratch->{url} =~ /^https?:\/\/images\.google\./) { > Does that look OK? Variant of your code: if ( $scratch->{url} =~ m#^https?://images\.google\.# ) { But you'd better go with Randal's "use URI;" advice. You're right, I hadn't grasped what URI was

Re: Matching the domain of a URL

2007-03-15 Thread Dr.Ruud
Grant schreef: > I ended up going with this: > if ($Scratch->{url} =~ /^https?:\/\/images\.google\./) { > Does that look OK? Variant of your code: if ( $scratch->{url} =~ m#^https?://images\.google\.# ) { But you'd better go with Randal's "use URI;" advice. -- Affijn, Ruud "Gewoon is

Re: Matching the domain of a URL

2007-03-15 Thread Grant
> > regex. > > if ( m/^https?\/\/:blah\.com/) > > > my @possible_values = qw{ >http://www.google.com >https://my.domain. >http://some.other.domain.net > }; > > my @urls = qw{ >http://www.google.com/?some_bizarre_args >https://my.domain.com >https://my.domain.net >http:

Re: Matching the domain of a URL

2007-03-15 Thread Jenda Krynicky
From: Igor Sutton Lopes <[EMAIL PROTECTED]> > On 2007/03/14, at 16:00, yitzle wrote: > > > regex. > > if ( m/^https?\/\/:blah\.com/) > > > my @possible_values = qw{ >http://www.google.com >https://my.domain. >http://some.other.domain.net > }; > > my @urls = qw{ >http://www.googl

Re: Matching the domain of a URL

2007-03-14 Thread Randal L. Schwartz
> "Grant" == Grant <[EMAIL PROTECTED]> writes: Grant> Hello, I need to do some special processing if the domain of a URL Grant> string matches a set of possible values. I'd like to catch http and Grant> https. What is the best way to do that? Keep in mind that www.stonehenge.com can be wri

Re: Matching the domain of a URL

2007-03-14 Thread Grant
My fault. The reason it does not match is the colon placement. It will match http//:images.google. Thanks, I really should have noticed that myself. - Grant > Can you correct my syntax? I can't get this to match: > > if ($Scratch->{url} =~ /^https?\/\/:images\.google\./) { > > The value of r

Re: Matching the domain of a URL

2007-03-14 Thread yitzle
My fault. The reason it does not match is the colon placement. It will match http//:images.google. Can you correct my syntax? I can't get this to match: if ($Scratch->{url} =~ /^https?\/\/:images\.google\./) { The value of referrer is exactly: http://images.google. -- To unsubscribe, e-mai

Re: Matching the domain of a URL

2007-03-14 Thread Igor Sutton Lopes
On 2007/03/14, at 16:00, yitzle wrote: regex. if ( m/^https?\/\/:blah\.com/) my @possible_values = qw{ http://www.google.com https://my.domain. http://some.other.domain.net }; my @urls = qw{ http://www.google.com/?some_bizarre_args https://my.domain.com https://my.domain.net h

Re: Matching the domain of a URL

2007-03-14 Thread Grant
regex. if ( m/^https?\/\/:blah\.com/) Can you correct my syntax? I can't get this to match: if ($Scratch->{url} =~ /^https?\/\/:images\.google\./) { The value of referrer is exactly: http://images.google. - Grant > Hello, I need to do some special processing if the domain of a URL > strin

Re: Matching the domain of a URL

2007-03-14 Thread Igor Sutton Lopes
On 2007/03/14, at 15:55, Jeff Pang wrote: Hello, I just think regex is the best way since you choose to use Perl doing this work. Regexp::Common::URI may be what you're looking for. -- Igor Sutton [EMAIL PROTECTED] -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands,

Re: Matching the domain of a URL

2007-03-14 Thread Grant
regex. if ( m/^https?\/\/:blah\.com/) Ok, how can I pass in the value I want evaluated? Sorry I'm such a beginner. - Grant > Hello, I need to do some special processing if the domain of a URL > string matches a set of possible values. I'd like to catch http and > https. What is the best wa

Re: Matching the domain of a URL

2007-03-14 Thread yitzle
regex. if ( m/^https?\/\/:blah\.com/) On 3/14/07, Grant <[EMAIL PROTECTED]> wrote: Hello, I need to do some special processing if the domain of a URL string matches a set of possible values. I'd like to catch http and https. What is the best way to do that? - Grant -- To unsubscribe, e-mai

Re: Matching the domain of a URL

2007-03-14 Thread Jeff Pang
> >Hello, I need to do some special processing if the domain of a URL >string matches a set of possible values. I'd like to catch http and >https. What is the best way to do that? > Hello, I just think regex is the best way since you choose to use Perl doing this work. -- To unsubscribe, e-m

Matching the domain of a URL

2007-03-14 Thread Grant
Hello, I need to do some special processing if the domain of a URL string matches a set of possible values. I'd like to catch http and https. What is the best way to do that? - Grant -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn.pe