lib/banhammer.rb
####
# Returns the total number of emails found in the body of text
####
Returns the total number of emails found in the body of text
Returns the total number of emails found in the body of text
def check_for_emails(body)
      count = 0
      body.gsub(/[a-z0-9\._-]+@{1}[a-z0-9\.]+/i) { |s| count += 1 }
      count
    end
def check_for_emails ( body ) count = 0 body . gsub ( / [a-z0-9 \. _-]+@{1}[a-z0-9 \. ]+ /i ) { | s | count += 1 } count end
Returns the total number of emails found in the body of text
Returns the total number of emails found in the body of text
body
<not_specific>