in reply to matching a Url
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)
|
|---|