%% Separate Comma-Separated List
% Separate a comma-separated list by using wildcardPattern.
% Create txt as a string. Build a pattern using wildcardPattern that matches as many characters of any type except "," followed by whitespace characters. Extract the pattern.

txt = "1 fish, 2 Fish, [1,0,0] fish, [0,0,1] fish";
exceptPat = "," + whitespacePattern;
pat = asManyOfPattern(wildcardPattern(1,inf,"Except",exceptPat),1);
extract(txt,pat)

% Copyright 2020 The MathWorks, Inc.