Update regex to match http and https entities

There's no rule or something that Tent entities have to be https so you should check whether they are http or https. I updated the regex to do just that (also updated some comments to show what the new code is doing).