it can end with any whitespace character.
i'm currently fiddling to adopt Django's approach: (?:/?|[/?]\S+)$