public function findBranch(string $part): ?RouteBranch
    {
        // Try finding an exact match first.
        if( array_key_exists($part, $this->branches) ){
            return $this->branches[$part];
        }

        // Loop through each branch key and match it using a regex.
        foreach( $this->branches as $key => $branch ){
            if( preg_match("/^{$key}$/", $part) ){
                return $branch;
            }
        }

        return null;
    }