update string manipulation to handle how expressjs does wildcard routing