Your regex pattern doesn't ensure that there is a period (dot) before the last match is made. So http://test
is matching:
http://
te
st
And you need to update your pattern to ensure that there are dots in the correct place. Remember to escape the dot is it isn't a wildcard.