Fixed regex for matching trailing slashes