Hi guys,
I'm currently working on a regular expression and it's almost working... can't find the solution to my problem and i now start to beleve that there's no way to make it. Any what i basically need to do is a regular expression that would match all <a href> tags in a page and return the url contained in it. The problem is that it matchs things i don't want, and i stuck on finding a solution.
here's the php command i use.
preg_match("/[hH][rR][eE][fF]=\"?'?[^\s\"']*\"?'? ?/", $in[$i], $out);
This command works, but it matchs things like href="mailto: ..." and href="javascript: ... ". I could remove them by doing a strstr on 'em but i'd really prefer that the preg_match would'nt return 'em to me.
Does anyone know's if it's possible to do?
Spazm
I'm currently working on a regular expression and it's almost working... can't find the solution to my problem and i now start to beleve that there's no way to make it. Any what i basically need to do is a regular expression that would match all <a href> tags in a page and return the url contained in it. The problem is that it matchs things i don't want, and i stuck on finding a solution.
here's the php command i use.
preg_match("/[hH][rR][eE][fF]=\"?'?[^\s\"']*\"?'? ?/", $in[$i], $out);
This command works, but it matchs things like href="mailto: ..." and href="javascript: ... ". I could remove them by doing a strstr on 'em but i'd really prefer that the preg_match would'nt return 'em to me.
Does anyone know's if it's possible to do?
Spazm
Comment