#!/usr/local/bin/ruby require 'pp' #https://anond.hatelabo.jp/archive/200609 #https://anond.hatelabo.jp/archive/201708 url = "https://anond.hatelabo.jp/archive/" year_urls = [] (6..17).each do |n| n = "0" + n.to_s unless n.to_s =~ %r|^[1][0-7]$| year = "20" + n.to_s year_urls << url + year end year_urls.each do |year_url| (0..12).each do |n| # n = "0" + n.to_s unless n =~ %r|^[0-9][0-2]$| #integerオブジェクトは正規表現マッチできなかったから注意 n = "0" + n.to_s unless n.to_s =~ %r|^[0-9][0-2]$| puts year_url + n.to_s end end