feat($resource): support an unescaped url

Added new regex to test the url parameters with:
- if the parameter consists only of numbers, then it's a port

Allows to write a URL normally.

Escaping the port does not comply with the [URL syntax](http://en.wikipedia.org/wiki/Uniform_resource_locator#Syntax)

Regular Expression and it's position in the if clause are meant to short-circuit ASAP.

Refer to #2652