%% Match Any Text in List
% Create a string array of names, where some names contain either Ann or Paul.

str = ["Mary Ann Jones","Christopher Matthew Burns","John Paul Smith"]

%
% Find the elements of str that contain either Ann or Paul.

pat = ["Ann","Paul"];
TF = contains(str,pat)

%
% Index back into str using TF.

str(TF)

% Copyright 2012-2020 The MathWorks, Inc.