URL completo Regex -> URL base

URL completo: http://stackoverflow.com/questions/6038061/regular-expression-to-find-urls-within-a-string Base: stackoverflow.com Regex: (http (s)?: / /) | ( /.*) {1} Exemplo em JavaScript: function toBaseURL(fullURL){ return fullURL.replace(/(http(s)?://)|(/.*){1}/g, ”);}

Continuar lendo