%% Match Start and End Boundaries of Whitespaces
% Use the "start" and "end" options for whitespaceBoundary to match the boundary between whitespaces and non-whitespace characters.
% Create a string that contains several different character types. Create a pattern that matches any characters between an "end" boundary of whitespaces and a "start" boundary.

txt = "123 abc .?! def 456";
pat = whitespaceBoundary("end") + wildcardPattern(1,inf) + whitespaceBoundary("start");

% Extract the pattern.

boundaries = extract(txt,pat)

% Copyright 2020 The MathWorks, Inc.