<?php

$string = file_get_contents("test.txt");
$regExp = "/\\b[a-z]{1,4}\\b/ui";
$result = [];
preg_match_all($regExp, $string, $result);
echo count($result[0]);