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