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.

http://jsfiddle.net/funkyeah/weqzz/

it strips trailing slash. single slash /


Comments

Popular posts from this blog

c# - DetailsView in ASP.Net - How to add another column on the side/add a control in each row? -

javascript - firefox memory leak -

Trying to import CSV file to a SQL Server database using asp.net and c# - can't find what I'm missing -