count = (content, pattern) => {
    // Split is slightly faster than match.
    if (typeof pattern === 'string') {
      return content.split(pattern).length - 1;
    }

    return (content.match(pattern) ?? []).length;
  }
@param {string} content
@param {RegExp|string} pattern
@return {number}