whole_func_string: function hasPattern(s, pattern) {
      const m = pattern.exec(s)
      return m != null && (m[1] || "").length % 2 === 0
  }
func_code_string: function hasPattern(s, pattern) {
      const m = pattern.exec(s)
      return m != null && (m[1] || "").length % 2 === 0
  }
func_documentation_string: Check a given string has a given pattern.
  @param {string} s A string to check.
  @param {RegExp} pattern A RegExp object to check.
  @returns {boolean} `true` if the string has the pattern.