private function buildMap(array $map, string $join): string
    {
        $alt = [];
        foreach ($map as $type => $re) {
            $alt[] = "(?<$type>$re)";
        }
        if (false !== $join) {
            $alt = join($join, $alt);
        }
        return $alt;
    }
private function buildMap(array $map, string $join): string
    {
        $alt = [];
        foreach ($map as $type => $re) {
            $alt[] = "(?<$type>$re)";
        }
        if (false !== $join) {
            $alt = join($join, $alt);
        }
        return $alt;
    }
private function buildMap ( array $ map , string $ join ) : string { $ alt = [ ] ; foreach ( $ map as $ type => $ re ) { $ alt [ ] = "(?<$type>$re)" ; } if ( false !== $ join ) { $ alt = join ( $ join , $ alt ) ; } return $ alt ; }
Build regexp map into one regexp part or list of ready parts

Input map is key=>value paired array. Key which is name will become name for named regexp
group, and value will becove its body. So `'int' => '\\d+'` will become `(?<int>\\d+)`.

The result is one regexp part of built subparts joined with delimiter. Joining can be
bypassed with `$join = false` argument.
@param string[] $map Input map of regexps.
@param string $join Join with delimiter.
@return string Returns joined regexp part
Build regexp map into one regexp part or list of ready parts