fork(1) download
  1. def count_word_occurrences(text: str, word: str = "мен") -> int:
  2. # \b
  3. pattern = rf"\b{re.escape(word)}\b"
  4. return len(re.findall(pattern, text, flags=re.IGNORECASE | re.UNICODE))
Success #stdin #stdout 0.1s 14084KB
stdin
200
stdout
Standard output is empty