Remove unnecessary trailing slash in the regex