Counts the number of occurrences of value.
int countOccurrence(String string) => isEmpty ? 0 : RegExp(string).allMatches(this).length;