Web Hosting Talk







View Full Version : regex problem / block certain things?


Fallzone
07-10-2005, 07:06 PM
Im currently trying to crawl game cheat pages but when im crawling some pages some parts of the websites follows which i dont want it to do.
Is there a way to block some things?

heres the php file which crawls if you click on the link ull see what i mean. i just want the links below and the titles to the links not the above crap.
http://www.megagamecheats.net/admin/crawltest.php


$Pattern = "/(?ims)\<a(.*?)href=\"(.*?)\">(.*?)<\/a>\<br\>/";

heres my regex code it might suck cuz i pretty much blow at regex hehe
Is there away to block certain lines in php somehow?


Best Regards
Jawn

John[H4Y]
07-10-2005, 07:30 PM
I'm not sure exactly what you are trying to do but:

first, the "(?" doesn't make any sense.. () is a grouper and you are putting a question mark inside the first parenthesis.. doesn't do anything.

Also, where you have ".*?" it's pointless.. ".*" means ZERO or more of any character and then the ? makes it optional.. however, .* by itself is already optional.