So I am trying to match email to email domains (ie bob@test to @test.com). Both the array of emails and email domains are in separate arrays. Right now I am trying the following
It is not clear what you are trying to do with a regex. This is a minimum fix to make it run. It does not use a regex.
@Domains.each do |domain| if @Emails.any?{|email| email.end_with?(domain)} #do stuff end end