function getOccurrence(value, expression) {
  const count = value.match(expression)

  return (count ? count.length : 0) / value.length || 0
}
Get the occurrence ratio of `expression` for `value`.

@param {string} value
  Value to check.
@param {RegExp} expression
  Code-point expression.
@return {number}
  Float between 0 and 1.