in reply to URL Regex Matching, again

Not exactly what you requested, but this works for this particular case (and should work genericly except for cases like 'http://www.foo.com/bar/bar/')
#!/usr/bin/perl -l use strict; use warnings; use URI; for ( 'http://www.foo.com/bar/foobar/bar.html', 'http://www.foo.com/bar/foobar/', 'http://www.foo.com/bar/foobar', 'http://www.foo.com/bar/', 'http://www.foo.com/bar', ) { my $uri = URI->new($_); my $path = $uri->path; my @part = split('\/',$path); # use File::Basename here for portab +ility print "$_: ", ($part[-1] eq 'bar') ? 'yes' : 'no'; }

jeffa

L-LL-L--L-LL-L--L-LL-L--
-R--R-RR-R--R-RR-R--R-RR
B--B--B--B--B--B--B--B--
H---H---H---H---H---H---
(the triplet paradiddle with high-hat)