Map names are being displayed as 'mapdir//name' this is because
the regex is always adding a / but then when we construct the path
to the map we use '..$MAPDIR/..' so we're already adding the slash
so the regex should be changed to remove all trailing slashes entirely.
Map names are being displayed as 'mapdir//name' this is because the regex is always adding a / but then when we construct the path to the map we use '..$MAPDIR/..' so we're already adding the slash so the regex should be changed to remove all trailing slashes entirely.