update regex for matching URLs, fixes issue #1386

This fix is pretty straightforward. I didn't found unittests for this function so leave this as-is. I'm not very good with conventions in this project, so if you cat tell me in which file I should add tests for this issue, I'll do it. 

If you ok with no tests, just merge this. I've checked this patch against example presented in issue.