module RuboCop::Cop::RegexpMetacharacter

def drop_end_metacharacter(regexp_string)

def drop_end_metacharacter(regexp_string)
  if regexp_string.end_with?('\\z')
    regexp_string.chomp('\z') # drop `\z` anchor
  else
    regexp_string.chop # drop `$` anchor
  end
end