I have the following:
preg_match_all("'HREF=\"([
^>]*?)\"(.
*?)'is",
$messageBody,
$linkHrefs, PREG_PATTERN_ORDER);
This works great if the link is correct (and has "" I believe). What the issue is if someone does this
<a href = "
http://test.com"> <-- notice the spaces between href =
Another one could be
<a href='
http://test.com'> <-- using ' instead of "
Is there any way to modify my regex so that it handles this alot more and gets MOST, if not all links, regardless of 100% perfection?
Thank you!
Open in new window