public static function countWords(string $text): int
    {
        // split text by ' ',\r,\n,\f,\t
        $split_array = preg_split('/\s+/', $text);
        // count matches that contain alphanumerics
        $word_count = preg_grep('/[a-zA-Z0-9\\x80-\\xff]/', $split_array);

        return count($word_count);
    }