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