
perlkid
stranger
Oct 7, 2000, 12:07 AM
Post #3 of 4
(6647 views)
|
Sorry, I miss explained that. I should have said I am trying to use this code for matching urls. I'm trying to Identify the base domain urls from the other kinds. I have been successfull so far. Thanks For The Great Regex Though, Don't think for a minuet I'm not going to use that! This is my first week that I'm really going to Dive into regex, I think it's very important for me to learn, and I'm reading as much as I can about it. I think that this will work, correct me if I'm wrong, <BLOCKQUOTE><font size="1" face="Arial,Helvetica,sans serif">code:</font><HR> if($f[3] =~ m!(.*?)\.(.*?)/(.*{1}?)/!){ if ($3 eq "index.html" | | $3 eq "index.htm" | | $3 eq "main.htm" | | $3 eq "main.html" | | $3 eq "default.asp"){ push(@good, $_); } }else{ push(@good, $_); } </pre><HR></BLOCKQUOTE> That way, http://www.perlguru.com/index.html http://www.perlguru.com/ http://www.perl.com/index.htm Are pushed into @good and stuff like http://www.perlguru.com/cgi-bin/forum/postings.cgi http://www.perlguru.com/Ultimate.cgi http://www.perlguru.com/forum/anotherpage.html Aren't pushed into @good Do you think I can have my Regex Diploma Now or Do I still Have A Long Way To Go, perlkid ------------------ I'm Studying Regular Expressions and My Cat Is Still Shedding My Blood From Time to Time.
|