複数の正規表現にmatch?するかの判定の実装
words = %w(foo bar baz) => ["foo", "bar", "baz"] regexp = Regexp.union(words) => /foo|bar|baz/ 'foo'.match?(regexp) => true 'bar'.match?(regexp) => true 'baz'.match?(regexp) => true
words = %w(foo bar baz) => ["foo", "bar", "baz"] regexp = Regexp.union(words) => /foo|bar|baz/ 'foo'.match?(regexp) => true 'bar'.match?(regexp) => true 'baz'.match?(regexp) => true