class RuboCop::Cop::Performance::StringReplacement

def accept_first_param?(first_param)

def accept_first_param?(first_param)
  first_source, options = first_source(first_param)
  return true if first_source.nil?
  unless first_param.str_type?
    return true if options
    return true unless first_source.is_a?(String) && first_source =~ DETERMINISTIC_REGEX
    # This must be done after checking DETERMINISTIC_REGEX
    # Otherwise things like \s will trip us up
    first_source = interpret_string_escapes(first_source)
  end
  first_source.length != 1
end