in reply to matching a Url

First off, <A HREF="http://www.cnn.com/WEATHER/index.html"> isn't an url. Its the open element of an Anchor tag. If you are trying to skip anchor tags based on the url then I wouldnt try to match a full tag, (think of all the possible other attrbutes a tag can have which will make the match fail), but rather the url within the tag (even then I wonder... Have a look at HTML::LinkExtor for other ideas.)

The below will print "matches".

my $str='<A HREF="http://www.cnn.com/WEATHER/index.html">'; print "matches!" if $str=~m!href\s*=\s*\Q['"]http://www.cnn.com/WEATHE +R/index.html['"]\E!i;

If this is part of some regex based HTML parser then I suggest you look into using HTML::Parser or its more useful (but greedy) child class, HTML::TreeBuilder. Frankly I would use modules like that becuase the intracacies of HTML make it difficult to parse properly with regexen.

update: thanks to the CB for some HTML clarifications while writing this.

Yves / DeMerphq
---
Software Engineering is Programming when you can't. -- E. W. Dijkstra (RIP)