%% Negating Boundaries of Whitespaces
% Use the ~ operator to negate whitespaceBoundary. This matches boundaries between two characters when both are whitespace characters or neither is a whitespace character.
% Create a string that contains several different character types. Create a pattern that matches a negated whitespaceBoundary.

txt = "123 abc .?!";
pat = ~whitespaceBoundary;

% Use replace to insert "|" characters to show where ~whitespaceBoundary matches.

boundaries = replace(txt,pat,"|")

% Copyright 2020 The MathWorks, Inc.