I found a link in a tweet that my current regex won’t parse and I can’t seem to figure out how to get it working (probably due to my ineptness with regex).
Here’s the current code:
preg_match_all('@((https?://)?([-\w]+\.[-\w\.]+)+\w(:\d+)?(/([-\w/_\.]*(\?\S+)?)?)*)@',$description, $matches, PREG_SET_ORDER);
And the Tweet that won’t parse:
Amazon: 14-day lending coming to
Kindle “later this year”.
http://usat.me?128426
It’s the usat.me link that’s screwing things up. Any thoughts?
Try that. Should work. modified the / to be (/)? meaning the last slash is supposed to be there 0 or 1 times.