<commit_before>class Regexp
  def self.build(*args)
    reg = args.map do |arg|
      if arg.is_a? Range
        arg.to_a
      else
        arg
      end
    end
    Regexp.new(/\A(?:#{reg.flatten.uniq.join('|')})\z/)
  end
end

lucky = Regexp.build(3, 7)
p "7"  =~ lucky # => true
p "13" =~ lucky # => false
p "3"  =~ lucky # => true

month = Regexp.build(1..12)
p "0"  =~ month # => false
p "1"  =~ month # => true
p "12" =~ month # => true

day = Regexp.build(1..31)
p "6"    =~ day # => true<commit_msg>refactoring quiz<commit_after># Add a class method 'build' to Regexp
class Regexp
  def self.build(*args)
    reg = args.map do |arg|
      arg.is_a?(Range) ? arg.to_a : arg
    end
    Regexp.new(/\A(?:#{reg.flatten.uniq.join('|')})\z/)
  end
end

lucky = Regexp.build(3, 7)
p "7"  =~ lucky # => true
p "13" =~ lucky # => false
p "3"  =~ lucky # => true

month = Regexp.build(1..12)
p "0"  =~ month # => false
p "1"  =~ month # => true
p "12" =~ month # => true

day = Regexp.build(1..31)
p "6"    =~ day # => true
{'fraction_non_alphanumeric': 0.20625610948191594, 'fraction_numerical': 0.033235581622678395, 'mean_word_length': 2.4829931972789114, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 17, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1152007', 'n_tokens_mistral': 456, 'n_tokens_neox': 447, 'n_words': 112}