Come for the quick hacks, stay for the epiphanies. | |
PerlMonks |
regexp: Mind-boggling negative assertions...by Robidu (Acolyte) |
on Aug 16, 2015 at 23:04 UTC ( [id://1138793]=perlquestion: print w/replies, xml ) | Need Help?? |
Robidu has asked for the wisdom of the Perl Monks concerning the following question: Greetings! I'm attempting to check an URL with a regexp on whether or not it matches certain criteria (that is, an extremely strict check that is supposed to only let particular URLs pass and reject the rest). However, for some reason it doesn't work as expected. Here's the code sample in question:
The URL as given in this sample correctly causes a nonmatch. Removing "www." from the URL in turn correctly gives a match of the regexp. However, when the "www." in the example is replaced by, for example, "forum." and the check run again, it indicates a nonmatch (and subsequently lets the URL pass) instead of matching and thereby rejecting it. So what could possibly be going wrong here? Any help would be greatly appreciated.
Back to
Seekers of Perl Wisdom
|
|