<?php

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