in reply to regexp: Mind-boggling negative assertions...
This is because a negative lookahead ((?!)) is a zero-width assertion, and doesn't capture anything, nor does it take up any space at all. That means that if the part isn't 'www.', it effectively is blank space so nothing will ever match there.
Try this, and go from there
/^https?:\/\/.*?\.?(?<!www\.)robidu\.de\//;
It checks for anything non-greedy up to an optional dot, but if what is prior to the domain name is "www.", it's a no match. This uses a negative lookbehind, which is also a zero-width assertion (same as a negative lookahead), but the difference is that it can see anything else there prior to the lookbehind.
With that said, if you're wanting to allow only certain names, you might consider something like this, instead of looking negatively:
my $r = 'https://forum.robidu.de/'; my @allowed = qw(ww2 forum); my $re = join('|', @allowed); print $r =~ /^https?:\/\/$re\.?robidu\.de\//;
-stevieb
|
|---|