def match_xxx_for_country( name, xxx )  # xxx e.g. cities|states|beers|breweries
    #      auto-add required country code (from folder structure)
    #  note: always let match_xxx_for_country_n_state go first

    # note: allow  /cities and /1--hokkaido--cities
    xxx_pattern = "(?:#{xxx}|[0-9]+--[^\\/]+?--#{xxx})"    # note: double escape \\ required for backslash

    ##
    ## todo: add $-anchor at the end of pattern - why? why not?? (will include .txt or .yaml??)

    if name =~ /(?:^|\/)#{WORLD_COUNTRY_CLASSIC_PATTERN}\/#{xxx_pattern}/   ||    # (1)
       name =~ /(?:^|\/)#{WORLD_COUNTRY_MODERN_PATTERN}\/#{xxx_pattern}/    ||    # (2)
       name =~ /(?:^|\/)#{WORLD_COUNTRY_CODE_PATTERN}\/#{xxx_pattern}/      ||    # (3)
       name =~ /(?:^|\/)#{WORLD_COUNTRY_CLASSIC_PATTERN}\/[0-9]+--[^\/]+\/#{xxx_pattern}/ ||   # (4)
       name =~ /(?:^|\/)#{WORLD_COUNTRY_CODE_PATTERN}-[^\/]+--#{xxx}/    # (5)

      country_key = $1.dup
      yield( country_key )
      true # bingo - match found

      ######
      # (1)  new style: e.g. /at-austria/beers or ^at-austria!/cities
      #
      # (2)  new-new style e.g. /1--at-austria--central/cities
      #
      # (3)  classic style: e.g. /at/beers (europe/at/cities)
      #
      # (4) new style w/ state w/o abbrev/code e.g. /ja-japon/1--hokkaido/cities
      #
      # (5)  compact style (country part of filename):
      #   e.g. /at-austria--cities or /europe/at-austria--cities
    else
      false # no match found
    end
  end
def match_xxx_for_country( name, xxx )  # xxx e.g. cities|states|beers|breweries
    #      auto-add required country code (from folder structure)
    #  note: always let match_xxx_for_country_n_state go first

    # note: allow  /cities and /1--hokkaido--cities
    xxx_pattern = "(?:#{xxx}|[0-9]+--[^\\/]+?--#{xxx})"    # note: double escape \\ required for backslash

    ##
    ## todo: add $-anchor at the end of pattern - why? why not?? (will include .txt or .yaml??)

    if name =~ /(?:^|\/)#{WORLD_COUNTRY_CLASSIC_PATTERN}\/#{xxx_pattern}/   ||    # (1)
       name =~ /(?:^|\/)#{WORLD_COUNTRY_MODERN_PATTERN}\/#{xxx_pattern}/    ||    # (2)
       name =~ /(?:^|\/)#{WORLD_COUNTRY_CODE_PATTERN}\/#{xxx_pattern}/      ||    # (3)
       name =~ /(?:^|\/)#{WORLD_COUNTRY_CLASSIC_PATTERN}\/[0-9]+--[^\/]+\/#{xxx_pattern}/ ||   # (4)
       name =~ /(?:^|\/)#{WORLD_COUNTRY_CODE_PATTERN}-[^\/]+--#{xxx}/    # (5)

      country_key = $1.dup
      yield( country_key )
      true # bingo - match found

      ######
      # (1)  new style: e.g. /at-austria/beers or ^at-austria!/cities
      #
      # (2)  new-new style e.g. /1--at-austria--central/cities
      #
      # (3)  classic style: e.g. /at/beers (europe/at/cities)
      #
      # (4) new style w/ state w/o abbrev/code e.g. /ja-japon/1--hokkaido/cities
      #
      # (5)  compact style (country part of filename):
      #   e.g. /at-austria--cities or /europe/at-austria--cities
    else
      false # no match found
    end
  end
check: use double \\ or just \ ??