regex - What does the this javascript regular expression do?: "var match = self.location.href.replace(/\/$/i, '');" -
i saw expression in codebases library part of following sequence:
var url = sel.anchornode.parentnode.href; var match = self.location.href.replace(/\/$/i, ''); var replaced = url.replace(match,'');
it suggest regular expression might strip of trailing path reutrn base url created fiddle test theory , doesn't seem check out.
it strips trailing slash. single slash /
Comments
Post a Comment