class ActiveModel::Validations::FormatValidator

def regexp_using_multiline_anchors?(regexp)

def regexp_using_multiline_anchors?(regexp)
  source = regexp.source
  source.start_with?("^") || (source.end_with?("$") && !source.end_with?("\\$"))
end