ok finnaly found another way that this wont work, should be simple. Some sites use:
instead ofCode:<a href='http://www.site.com/OtherMethods.php'>
' for "Code:<a href="http://www.site.com/OtherMethods.php">
how should we predict this aswell?
Printable View
ok finnaly found another way that this wont work, should be simple. Some sites use:
instead ofCode:<a href='http://www.site.com/OtherMethods.php'>
' for "Code:<a href="http://www.site.com/OtherMethods.php">
how should we predict this aswell?
try this:regex can be a bit complicated. What makes it more complicated is that there is seldom a reason to use it, so it's easy to get out of practice. It is also best to use it as little as possible since it is processor heavy.Code:'/(<a.*?href=\"|\')(.*?)(\/\"|\'|\")/is'
getting back to the regex at hand though. I really am only barely grasping at what you are trying to do, but it seems well enough that I am able to be of some use to you ;) When using href it is best to use the double quotes so as to avoid potential errors. I believe the errors I speak of have to do with relative versus absolute urls, but this has not been an issue for long enough that I forget exactly what the problem was with using single quotes with href.
Let me know if the regex I posted above fails and with what and we will address that when the time comes.
that kinda did its job but the array was getting all messed up with the extra ' all over the place. so i did this:
just before preg_match_all, seems it should be fixed. For now... :)PHP Code:$result = str_replace("'", '"', $result);
This time I found an error. try the following instead
otherwisePHP Code:preg_match_all ('/(<a.*?href=\"|<a.*?href=\')(.*?)(\/\"|\'|\")/is', $result, $matches);
will match.Code:<a "http://www.site.com/OtherMethods.php">
The pcre created thus far could probably still be improved in several different ways yet, so if you see ways that it needs to be modified yet just let me know.