code: def _escape_regexp(s):
      
      return (
          str(s)
          .replace('|', '\\|')
          .replace('.', '\.')  # `.` has to be replaced before `*`
          .replace('*', '.*')
          .replace('+', '\+')
          .replace('(', '\(')
          .replace(')', '\)')
          .replace('$', '\\$')
      )
docs: escape characters with specific regexp use