%% Match Words Based on Length
% Use lettersPattern to exclude words with more than five letters.
% Create pat as a pattern that matches groups of five or more letters using lettersPattern. Extract the pattern.

txt = "Some of these words are longer than others.";
pat = lettersPattern(5,inf);
extract(txt,pat)

% Copyright 2020 The MathWorks, Inc.